| java.awt.Container com.xoetrope.awt.survey.XQuestion
All known Subclasses: com.xoetrope.awt.survey.XWrapQuestion, com.xoetrope.awt.survey.XKioskQuestion,
Method Summary | |
public void | addResponse(int value, String caption) | public void | clear() | public int | findCurrentResponse(int x, int y) | public boolean | fireActionEvent() Called by XClickListener to check if a response event should be sent to the
parent form. | public void | get() Updates the TextComponent with the value obtained from the data model. | public Object | getComponent() | public String | getCueFileName() | public int | getId() | public String | getOutputPath() | public Dimension | getPreferredSize() Gets the preferred size of the component. | public Question | getQuestion() Gets the question. | public int | getQuestionId() Gets the question id. | public int | getQuestionType() Gets the question type. | public String | getResponse() | public int | getScale() | public String | getSourcePath() | public String | getText() | public boolean | isLast() | public boolean | isOptionSelected(int idx) | public void | paint(Graphics sg) Render the question. | public void | paintStates() | public void | print(Graphics g) | public void | set() Updates the data model with the value retrieved from the TextComponent. | public int | setAttribute(String attribName, Object attribValue) Set one or more attributes of the component. | public void | setBounds(int x, int y, int w, int h) | public void | setLastQuestion(boolean isLast) Marks the question as being the last question on the form. | public void | setModel(XModel newNode, String newPath) Set the model node. | public void | setOutput(XModel newModel, String outputPath) Update the path values stored by this node. | public void | setOutputPath(String newPath) | public void | setScale(int newScale) Sets the scale. | public void | setSource(XModel newNode) Update the model node used in the binding. | public void | setSourcePath(String newPath) | public boolean | setState(int x, int y, int defResponse) | public void | setText(String s) Sets the control's text. | public void | update(Graphics g) | public void | updateSelectedState() |
MIN_SCALE | final protected static int MIN_SCALE(Code) | | |
cueColorcueBkColorresponseTextColorresponseTextBkColorquestionBkColorquestionTextColorcheckBkColorcheckColor | protected static Color cueColorcueBkColorresponseTextColorresponseTextBkColorquestionBkColorquestionTextColorcheckBkColorcheckColor(Code) | | |
currentProject | protected XProject currentProject(Code) | | The owner project and the context in which this object operates.
|
numResponses | protected int numResponses(Code) | | |
scale | protected int scale(Code) | | |
styleManager | protected static XStyleManager styleManager(Code) | | |
xScale | protected int xScale(Code) | | |
XQuestion | public XQuestion()(Code) | | Create a new question component
|
addResponse | public void addResponse(int value, String caption)(Code) | | Adds a new response option
Parameters: value - the value of the response Parameters: caption - the text |
clear | public void clear()(Code) | | Unchecks all the responses
|
findCurrentResponse | public int findCurrentResponse(int x, int y)(Code) | | Find a response state based on the coordinates of the mouse click
Parameters: x - the x coordinate of the mouse click Parameters: y - the y coordinate of the mouse click the response id or Integer.MIN_VALUE if a response was not selected |
fireActionEvent | public boolean fireActionEvent()(Code) | | Called by XClickListener to check if a response event should be sent to the
parent form. The control can also use this event to do post click processing
true if the parent is to be notified |
get | public void get()(Code) | | Updates the TextComponent with the value obtained from the data model.
|
getComponent | public Object getComponent()(Code) | | Get the component to which this binding is attached
|
getCueFileName | public String getCueFileName()(Code) | | Get the file name of the cue image
the file name |
getId | public int getId()(Code) | | Gets the question's id
The ID |
getOutputPath | public String getOutputPath()(Code) | | Get the output/save path
|
getPreferredSize | public Dimension getPreferredSize()(Code) | | Gets the preferred size of the component.
The PreferredSize for the component |
getQuestion | public Question getQuestion()(Code) | | Gets the question.
the question or null if none isreferenced |
getQuestionId | public int getQuestionId()(Code) | | Gets the question id.
The Question ID |
getQuestionType | public int getQuestionType()(Code) | | Gets the question type.
The Question type |
getResponse | public String getResponse()(Code) | | Gets the selected response
the response value |
getScale | public int getScale()(Code) | | Gets the scale being used by this question for its layout
the scale |
getSourcePath | public String getSourcePath()(Code) | | Get the model path
|
getText | public String getText()(Code) | | Gets the questions text
The question text |
isLast | public boolean isLast()(Code) | | Is this question rendered as the last question on the page?
true if rendered as the last question |
isOptionSelected | public boolean isOptionSelected(int idx)(Code) | | Checks to see if a praticular option is selected
Parameters: idx - the index of the option true if the option is selected |
paint | public void paint(Graphics sg)(Code) | | Render the question. A header is drawn containing the question text, then
the body of the question is filled. Within the body the cue image is drawn
followed by each response spaced equally and left aligned
Parameters: sg - the graphics context |
paintStates | public void paintStates()(Code) | | Repaints the responses so that the current response is shown
|
print | public void print(Graphics g)(Code) | | Print the page
Parameters: g - the printer graphics context |
set | public void set()(Code) | | Updates the data model with the value retrieved from the TextComponent.
|
setAttribute | public int setAttribute(String attribName, Object attribValue)(Code) | | Set one or more attributes of the component. Currently this handles the
attributes
- cue, value=Cue image filename
0 for success, non zero otherwise |
setBounds | public void setBounds(int x, int y, int w, int h)(Code) | | Sets the size and location of the component and rescales the content to match
Parameters: x - Parameters: y - Parameters: w - Parameters: h - |
setLastQuestion | public void setLastQuestion(boolean isLast)(Code) | | Marks the question as being the last question on the form. The last
question is rendered with an additioanl footer
Parameters: isLast - |
setModel | public void setModel(XModel newNode, String newPath)(Code) | | Set the model node. This method is called when the bound path is modified
Parameters: newNode - |
setOutput | public void setOutput(XModel newModel, String outputPath)(Code) | | Update the path values stored by this node. The output path is used to
store selection data and state.
Parameters: newModel - the new model for saving the output data |
setOutputPath | public void setOutputPath(String newPath)(Code) | | Set the model path for the output/state data
|
setScale | public void setScale(int newScale)(Code) | | Sets the scale. The scale controls the horizontal division of the question
area. Normally this would be set to the maximum number of responses in a
survey. For example if most questions have 5 possible answers then the scale
would be set to 5
Parameters: newScale - |
setSource | public void setSource(XModel newNode)(Code) | | Update the model node used in the binding. Note that this method does not
modify the path values stored by this node.
Parameters: newNode - the new model for the data source |
setSourcePath | public void setSourcePath(String newPath)(Code) | | Set the model path for the source data
|
setState | public boolean setState(int x, int y, int defResponse)(Code) | | Find a response state based on the coordinates of the mouse click
Parameters: x - the x coordinate of the mouse click Parameters: y - the y coordinate of the mouse click Parameters: defResponse - the default response true if a response was found |
setText | public void setText(String s)(Code) | | Sets the control's text. Used to localize the control. In the case of this
control the method does nothing since the questions are localized as part
of an entire questionaire.
Parameters: s - The new text to display. |
update | public void update(Graphics g)(Code) | | Refresh the display
Parameters: g - the graphics context |
updateSelectedState | public void updateSelectedState()(Code) | | Upates the state of the options
|
Methods inherited from java.awt.Container | public Component add(Component comp)(Code)(Java Doc) public Component add(String name, Component comp)(Code)(Java Doc) public Component add(Component comp, int index)(Code)(Java Doc) public void add(Component comp, Object constraints)(Code)(Java Doc) public void add(Component comp, Object constraints, int index)(Code)(Java Doc) public synchronized void addContainerListener(ContainerListener l)(Code)(Java Doc) protected void addImpl(Component comp, Object constraints, int index)(Code)(Java Doc) public void addNotify()(Code)(Java Doc) public void addPropertyChangeListener(PropertyChangeListener listener)(Code)(Java Doc) public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)(Code)(Java Doc) public void applyComponentOrientation(ComponentOrientation o)(Code)(Java Doc) public boolean areFocusTraversalKeysSet(int id)(Code)(Java Doc) public int countComponents()(Code)(Java Doc) public void deliverEvent(Event e)(Code)(Java Doc) public void doLayout()(Code)(Java Doc) public Component findComponentAt(int x, int y)(Code)(Java Doc) public Component findComponentAt(Point p)(Code)(Java Doc) public float getAlignmentX()(Code)(Java Doc) public float getAlignmentY()(Code)(Java Doc) public Component getComponent(int n)(Code)(Java Doc) public Component getComponentAt(int x, int y)(Code)(Java Doc) public Component getComponentAt(Point p)(Code)(Java Doc) public int getComponentCount()(Code)(Java Doc) public int getComponentZOrder(Component comp)(Code)(Java Doc) public Component[] getComponents()(Code)(Java Doc) public synchronized ContainerListener[] getContainerListeners()(Code)(Java Doc) public Set<AWTKeyStroke> getFocusTraversalKeys(int id)(Code)(Java Doc) public FocusTraversalPolicy getFocusTraversalPolicy()(Code)(Java Doc) public Insets getInsets()(Code)(Java Doc) public LayoutManager getLayout()(Code)(Java Doc) public T[] getListeners(Class<T> listenerType)(Code)(Java Doc) public Dimension getMaximumSize()(Code)(Java Doc) public Dimension getMinimumSize()(Code)(Java Doc) public Point getMousePosition(boolean allowChildren) throws HeadlessException(Code)(Java Doc) public Dimension getPreferredSize()(Code)(Java Doc) public Insets insets()(Code)(Java Doc) public void invalidate()(Code)(Java Doc) public boolean isAncestorOf(Component c)(Code)(Java Doc) public boolean isFocusCycleRoot(Container container)(Code)(Java Doc) public boolean isFocusCycleRoot()(Code)(Java Doc) final public boolean isFocusTraversalPolicyProvider()(Code)(Java Doc) public boolean isFocusTraversalPolicySet()(Code)(Java Doc) public void layout()(Code)(Java Doc) public void list(PrintStream out, int indent)(Code)(Java Doc) public void list(PrintWriter out, int indent)(Code)(Java Doc) public Component locate(int x, int y)(Code)(Java Doc) public Dimension minimumSize()(Code)(Java Doc) public void paint(Graphics g)(Code)(Java Doc) public void paintComponents(Graphics g)(Code)(Java Doc) protected String paramString()(Code)(Java Doc) public Dimension preferredSize()(Code)(Java Doc) public void print(Graphics g)(Code)(Java Doc) public void printComponents(Graphics g)(Code)(Java Doc) protected void processContainerEvent(ContainerEvent e)(Code)(Java Doc) protected void processEvent(AWTEvent e)(Code)(Java Doc) public void remove(int index)(Code)(Java Doc) public void remove(Component comp)(Code)(Java Doc) public void removeAll()(Code)(Java Doc) public synchronized void removeContainerListener(ContainerListener l)(Code)(Java Doc) public void removeNotify()(Code)(Java Doc) public void setComponentZOrder(Component comp, int index)(Code)(Java Doc) public void setFocusCycleRoot(boolean focusCycleRoot)(Code)(Java Doc) public void setFocusTraversalKeys(int id, Set<? extends AWTKeyStroke> keystrokes)(Code)(Java Doc) public void setFocusTraversalPolicy(FocusTraversalPolicy policy)(Code)(Java Doc) final public void setFocusTraversalPolicyProvider(boolean provider)(Code)(Java Doc) public void setFont(Font f)(Code)(Java Doc) public void setLayout(LayoutManager mgr)(Code)(Java Doc) public void transferFocusDownCycle()(Code)(Java Doc) public void update(Graphics g)(Code)(Java Doc) public void validate()(Code)(Java Doc) protected void validateTree()(Code)(Java Doc)
|
|
|