|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel net.sourceforge.webcompmath.draw.LimitControlPanel net.sourceforge.webcompmath.draw.beans.WCMLimitControlPanelBean
public class WCMLimitControlPanelBean
This class is intended for use with GUI builders. Since many (like Eclipse VE) can't handle indexed properties, and enabling them to support "add" semantics for adding coordinateRects to a limitControlPanel, this class uses a bit of a hack by providing three DisplayCanvas's that can be added to the limitControlPanel via setters. If you need more than three (pretty unlikely) you will have to do some hand-coding. The button options are also exposed as properties by this class using set/get methods. Note that buttons can only be added, not removed, so the set methods have no effect if called with an argument of false. Since buttons are only added at the time the panel is created, having an argument of false is only used when the designer changes his/her mind at design time. The SetLimits button is included by default, and hence there is no set method for it.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
javax.swing.JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class net.sourceforge.webcompmath.draw.LimitControlPanel |
---|
ALL_BUTTONS, animatorItems, buttonNames, buttons, coords, EQUALIZE, errorReporter, items, RESTORE, SAVE, serialNumber, SET_LIMITS, syncWith, twoColumn, xmax, xmin, ymax, ymin, ZOOM_IN, ZOOM_OUT |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
WCMLimitControlPanelBean()
the default constructor |
|
WCMLimitControlPanelBean(java.lang.String xminName,
java.lang.String xmaxName,
java.lang.String yminName,
java.lang.String ymaxName,
int buttonsToAdd,
boolean useTwoColumnsIfPossible)
Create a WCMLimitControlPanelBean containing input boxes labeled with the given names and containing whatever buttons are in the set buttonsToAdd. |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent evt)
Override to handle save/restore to include parametric parameters |
boolean |
getEqualize()
Get the equilize option |
WCMParametricCurveBean |
getParametricCurve1()
Get parametric curve controlled by this panel. |
WCMParametricCurveBean |
getParametricCurve2()
Get parametric curve controlled by this panel. |
WCMParametricCurveBean |
getParametricCurve3()
Get parametric curve controlled by this panel. |
boolean |
getParametricFields()
Get whether parametric fields are used. |
java.lang.String |
getParamName()
Get the name of the parameter variable. |
boolean |
getRestore()
Get the restore option |
boolean |
getSave()
Get the save option |
boolean |
getSetLimits()
Get the set limits option |
int |
getTIntervals()
Get the number of intervals. |
Value |
getTIntervalsValue()
Returns as a Value the tIntervals VariableInput. |
double |
getTMax()
Get the maximum parameter value. |
Value |
getTMaxValue()
Returns as a Value the tMax VariableInput. |
double |
getTMin()
Get the minimum parameter value. |
Value |
getTMinValue()
Returns as a Value the tMin VariableInput. |
double |
getXMax()
Get the xMax value. |
double |
getXMin()
Get the xMin value. |
double |
getYMax()
Get the yMax value. |
double |
getYMin()
Get the yMin value. |
boolean |
getZoomIn()
Get the zoom in option |
boolean |
getZoomOut()
Get the zoom out option |
void |
notifyControllerOnChange(Controller c)
Save the controller (used only for parametric fields). |
void |
removeSetLimitsButton()
Used to remove the default Set Limits button, so you can add buttons in pairs for two column mode. |
void |
restoreParams()
Restore tmin, tmax, and tintervals. |
void |
saveParams()
Save the current tmin, tmax, and tintervals. |
void |
setCanvas1(DisplayCanvas dc)
Set the canvas to be controlled by this limit control panel |
void |
setCanvas2(DisplayCanvas dc)
Set the 2nd canvas to be controlled by this limit control panel |
void |
setCanvas3(DisplayCanvas dc)
Set the 3rd canvas to be controlled by this limit control panel |
void |
setEqualize(boolean b)
This represents a button that will equalize the scales on the axes (of the first CoordinateRect that was added to this panel). |
void |
setParametricCurve1(WCMParametricCurveBean pc)
Tell the parametric curve to use the fields in the limit control panel for its tmin, tmax, and tintervals. |
void |
setParametricCurve2(WCMParametricCurveBean pc)
Tell the parametric curve to use the fields in the limit control panel for its tmin, tmax, and tintervals. |
void |
setParametricCurve3(WCMParametricCurveBean pc)
Tell the parametric curve to use the fields in the limit control panel for its tmin, tmax, and tintervals. |
void |
setParametricFields(boolean b)
Set whether to use tmin, tmax, intervals fields. |
void |
setParamName(java.lang.String name)
Set the name of the parameter variable. |
void |
setRestore(boolean b)
This represents a button that will restore previously saved coordinates. |
void |
setSave(boolean b)
This represents a button that will save the current limits, so they can be restored later with the restore button. |
void |
setTIntervals(int i)
Set the number of intervals. |
void |
setTMax(double d)
Set the maximum value for the parameter. |
void |
setTMin(double d)
Set the minimum value for the parameter. |
void |
setXMax(double d)
This method sets the xMax property. |
void |
setXMin(double d)
This method sets the xMin property. |
void |
setYMax(double d)
This method sets the yMax property. |
void |
setYMin(double d)
This method sets the yMin property. |
void |
setZoomIn(boolean b)
This represents a button that will zoom in on the center of the coordinate rect. |
void |
setZoomOut(boolean b)
This represents a button that will zoom out from the center of the coordinate rect. |
Methods inherited from class net.sourceforge.webcompmath.draw.LimitControlPanel |
---|
add, addAnimator, addButtons, addComponent, addComponentPair, addCoords, addCoords, addRange, checkInput, getButton, getButtonOptions, getErrorReporter, getLimits, getPreferredSize, getSerialNumber, getUseTwoColumnsIfPossible, paintComponent, processComponentEvent, setErrorReporter, setForeground, setLimits, setUseTwoColumnsIfPossible, sync |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public WCMLimitControlPanelBean()
public WCMLimitControlPanelBean(java.lang.String xminName, java.lang.String xmaxName, java.lang.String yminName, java.lang.String ymaxName, int buttonsToAdd, boolean useTwoColumnsIfPossible)
xminName
- Name to be used as a label for the xmin input box.xmaxName
- Name to be used as a label for the xmax input box.yminName
- Name to be used as a label for the ymin input box.ymaxName
- Name to be used as a label for the ymax input box.buttonsToAdd
- The set of buttons to be added to the panel. Can consist of
one or more of the constants SET_LIMITS, EQUALIZE, ZOOM_IN,
ZOOM_OUT, SAVE, and RESTORE, or'ed together.useTwoColumnsIfPossible
- If this is true, then the components in the panel will be
arranged into two columns instead of one (assuming that there
is room).Method Detail |
---|
public void setCanvas1(DisplayCanvas dc)
dc
- the DisplayCanvas (or WCMDisplayCanvasBean) to controllpublic void setCanvas2(DisplayCanvas dc)
dc
- the DisplayCanvas (or WCMDisplayCanvasBean) to controllpublic void setCanvas3(DisplayCanvas dc)
dc
- the DisplayCanvas (or WCMDisplayCanvasBean) to controllpublic void setEqualize(boolean b)
b
- public boolean getEqualize()
public void setZoomIn(boolean b)
b
- public boolean getZoomIn()
public void setZoomOut(boolean b)
b
- public boolean getZoomOut()
public void setSave(boolean b)
b
- public boolean getSave()
public void setRestore(boolean b)
b
- public boolean getRestore()
public boolean getSetLimits()
public void setXMin(double d)
d
- the new value for xMinpublic double getXMin()
public void setXMax(double d)
d
- the new value for xMaxpublic double getXMax()
public void setYMin(double d)
d
- the new value for yMinpublic double getYMin()
public void setYMax(double d)
d
- the new value for yMaxpublic double getYMax()
public void setParametricFields(boolean b)
b
- true or falsepublic boolean getParametricFields()
public java.lang.String getParamName()
public void setParamName(java.lang.String name)
name
- the variable name, such as "t"public void setTMin(double d)
d
- the min. valuepublic double getTMin()
public void setTMax(double d)
d
- the maximum value.public double getTMax()
public void setTIntervals(int i)
i
- num. of intervalspublic int getTIntervals()
public void setParametricCurve1(WCMParametricCurveBean pc)
pc
- the parametric curve to be controlled by this panelpublic WCMParametricCurveBean getParametricCurve1()
public void setParametricCurve2(WCMParametricCurveBean pc)
pc
- the parametric curve to be controlled by this panelpublic WCMParametricCurveBean getParametricCurve2()
public void setParametricCurve3(WCMParametricCurveBean pc)
pc
- the parametric curve to be controlled by this panelpublic WCMParametricCurveBean getParametricCurve3()
public void notifyControllerOnChange(Controller c)
notifyControllerOnChange
in interface InputObject
notifyControllerOnChange
in class LimitControlPanel
c
- controller to notifyLimitControlPanel.notifyControllerOnChange(net.sourceforge.webcompmath.awt.Controller)
public Value getTMinValue()
public Value getTMaxValue()
public Value getTIntervalsValue()
public void removeSetLimitsButton()
public void actionPerformed(java.awt.event.ActionEvent evt)
actionPerformed
in interface java.awt.event.ActionListener
actionPerformed
in class LimitControlPanel
evt
- event created when user clicks a buttonLimitControlPanel.actionPerformed(java.awt.event.ActionEvent)
public void saveParams()
public void restoreParams()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |