Class JaxoOptionsPanel
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
net.sf.jaxodraw.gui.panel.edit.JaxoOptionsPanel
- All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, JaxoObjectEditPanel
A parent class for all option panels.
- Since:
- 2.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class JPanel
JPanel.AccessibleJPanelNested classes/interfaces inherited from class JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
Fields inherited from class JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields inherited from interface JaxoObjectEditPanel
TYPE_COLOR, TYPE_FILL_COLOR, TYPE_LINE_COLOR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidadd2PointsPanel(Point[] points, int gridx, int gridy) Adds a 2PointEdit panel at the given position with the given width.final voidadd3PointsPanel(Point[] points, int gridx, int gridy) Adds a 3points panel at the given position.final voidadd3PointsPanel(Point[] points, int gridx, int gridy, int gridwidth) Adds a 3points panel at the given position with the given width.final voidadd4PointsPanel(Point[] points, int gridx, int gridy) Adds a 4points panel at the given position.final voidadd4PointsPanel(Point[] points, int gridx, int gridy, int gridwidth) Adds a 4points panel at the given position with the given width.final voidaddArrowOptionsEditPanel(JaxoArrow arrow, int gridx, int gridy) Adds an edit panel for an arrow at the given position.final voidaddArrowPanel(boolean arrow, boolean flip, float oldPosition, int gridx, int gridy) Adds an arrow panel for an object at the given position.final voidaddCenterSizePanel(int x, int y, int w, int h, int gridx, int gridy) Adds a position/size panel at the given position.voidChangeEvents will be fired everytime the object that is being edited changes.final voidaddColorPanel(Color color, int type, int gridx, int gridy) Adds a color panel at the given position.final voidaddDashPanel(float dash, int gridx, int gridy) Adds a dash panel for an arc object at the given position.final voidaddDoubleLinePanel(boolean dLine, float dlSep, int gridx, int gridy) Adds a double line panel for an object at the given position.final voidaddFillLineColorPanels(Color color, Color fillColor, boolean isFilled, int fillX, int fillY, int lineX, int lineY) Adds a fill and a line color panel at the given positions.final voidaddLatexAlignPanel(int allign, int gridx, int gridy) Adds a latex align edit panel at the given position.final voidaddLatexFontSizePanel(int size, int gridx, int gridy) Adds a latex font size edit panel at the given position.final voidaddLineColorPanel(Color color, int gridx, int gridy) Adds a line color panel at the given position.final voidaddPositionPanel(int x, int y, int gridx, int gridy) Adds a position edit panel at the given position with the given width.final voidaddPSFontPanel(Font font, int gridx, int gridy, int gridwidth) Adds a postscript text font edit panel at the given position.final voidaddReScalePanel(int gridx, int gridy) Adds a scale panel for an object at the given position.final voidaddRotationPanel(int angle, int gridx, int gridy) Adds a rotation panel for a vertex at the given position.final voidaddStretchingPanel(boolean noFreqStretching, int gridx, int gridy) Adds a stretching panel for a photon bezier at the given position.final voidaddStrokePanel(float width, int gridx, int gridy) Adds a stroke panel for an arc object at the given position.final voidaddSymmPanel(boolean symm, int gridx, int gridy) Adds a symmetry panel for a photon line at the given position.final voidaddTextPanel(String text, int gridx, int gridy) Adds a text edit panel at the given position.final voidaddWigglePanel(int amp, int gridx, int gridy) Adds a wiggle panel for a group at the given position.final voidaddWigglePanel(int amp, int wiggles, int gridx, int gridy) Adds a wiggle panel for an object at the given position.final voidaddXYRPanel(int x, int y, int r, int gridx, int gridy) Adds a XYR panel at the given position.protected voidNotifies all listeners of a state change.final JaxoObjectThe object that is being edited.List of numbers of default rotation angles to display to the user.booleanDetermines wether the object has been modified.voidRemoves a change listener.protected voidReset 'object' (and GUI) to initial value.final voidsetObject(JaxoObject value) Set the object that is being edited.voidsetTitleAndIcon(String newTitle, String newIcon) Set title (message key) and icon (filename) that are displayed in the dialog.final voidDisplay the EditPanel for the current object.protected final voidshowDialog(Component parent, Location l) Show a dialog for this panel.Methods inherited from class JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods inherited from class 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, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, 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, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateMethods inherited from class 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, transferFocusDownCycle, validate, validateTreeMethods inherited from class 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, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Constructor Details
-
JaxoOptionsPanel
Constructor: initializes the panel.- Parameters:
ob- The object to be edited by this panel.
-
-
Method Details
-
getRotationAngleDefaults
-
addChangeListener
ChangeEvents will be fired everytime the object that is being edited changes.- Specified by:
addChangeListenerin interfaceJaxoObjectEditPanel- Parameters:
l- The listener to add.
-
removeChangeListener
Removes a change listener.- Parameters:
l- The listener to remove.
-
fireStateChanged
protected void fireStateChanged()Notifies all listeners of a state change. -
setObject
Set the object that is being edited.- Parameters:
value- the object that is being edited.
-
getObject
The object that is being edited.- Returns:
- the currently edited object.
-
add3PointsPanel
Adds a 3points panel at the given position.- Specified by:
add3PointsPanelin interfaceJaxoObjectEditPanel- Parameters:
points- The points of the arc object to be edited by this panel.gridx- The x position of the subpanel.gridy- The y position of the subpanel.
-
add3PointsPanel
Adds a 3points panel at the given position with the given width.- Specified by:
add3PointsPanelin interfaceJaxoObjectEditPanel- Parameters:
points- The points of the object to be edited by this panel.gridx- The x position of the subpanel.gridy- The y position of the subpanel.gridwidth- The width of the subpanel.
-
add4PointsPanel
Adds a 4points panel at the given position.- Specified by:
add4PointsPanelin interfaceJaxoObjectEditPanel- Parameters:
points- The points of the object to be edited by this panel.gridx- The x position of the subpanel.gridy- The y position of the subpanel.
-
add4PointsPanel
Adds a 4points panel at the given position with the given width.- Specified by:
add4PointsPanelin interfaceJaxoObjectEditPanel- Parameters:
points- The points of the object to be edited by this panel.gridx- The x position of the subpanel.gridy- The y position of the subpanel.gridwidth- The width of the subpanel.
-
addPositionPanel
public final void addPositionPanel(int x, int y, int gridx, int gridy) Adds a position edit panel at the given position with the given width.- Specified by:
addPositionPanelin interfaceJaxoObjectEditPanel- Parameters:
x- The x position of the object to be edited by this panel.y- The y position of the object to be edited by this panel.gridx- The x position of the subpanel.gridy- The y position of the subpanel.
-
add2PointsPanel
Adds a 2PointEdit panel at the given position with the given width.- Specified by:
add2PointsPanelin interfaceJaxoObjectEditPanel- Parameters:
points- The points of the object to be edited by this panel.gridx- The x position of the subpanel.gridy- The y position of the subpanel.
-
addXYRPanel
public final void addXYRPanel(int x, int y, int r, int gridx, int gridy) Adds a XYR panel at the given position.- Specified by:
addXYRPanelin interfaceJaxoObjectEditPanel- Parameters:
x- The x position of the object to be edited by this panel.y- The r position of the object to be edited by this panel.r- The radius of the object to be edited by this panel.gridx- The x position of the subpanel.gridy- The y position of the subpanel.
-
addCenterSizePanel
public final void addCenterSizePanel(int x, int y, int w, int h, int gridx, int gridy) Adds a position/size panel at the given position.- Specified by:
addCenterSizePanelin interfaceJaxoObjectEditPanel- Parameters:
x- The x position of the object to be edited by this panel.y- The y position of the object to be edited by this panel.w- The width of the object to be edited by this panel.h- The height of the object to be edited by this panel.gridx- The x position of the subpanel.gridy- The y position of the subpanel.
-
addDashPanel
public final void addDashPanel(float dash, int gridx, int gridy) Adds a dash panel for an arc object at the given position.- Specified by:
addDashPanelin interfaceJaxoObjectEditPanel- Parameters:
dash- The dash sizie of the object to be edited by this panel.gridx- The x position of the subpanel.gridy- The y position of the subpanel.
-
addStrokePanel
public final void addStrokePanel(float width, int gridx, int gridy) Adds a stroke panel for an arc object at the given position.- Specified by:
addStrokePanelin interfaceJaxoObjectEditPanel- Parameters:
width- The the stroke width of the object to be edited by this panel.gridx- The x position of the subpanel.gridy- The y position of the subpanel.
-
addReScalePanel
public final void addReScalePanel(int gridx, int gridy) Adds a scale panel for an object at the given position.- Specified by:
addReScalePanelin interfaceJaxoObjectEditPanel- Parameters:
gridx- The x position of the subpanel.gridy- The y position of the subpanel.
-
addWigglePanel
public final void addWigglePanel(int amp, int wiggles, int gridx, int gridy) Adds a wiggle panel for an object at the given position.- Specified by:
addWigglePanelin interfaceJaxoObjectEditPanel- Parameters:
amp- The oamplitude of the bject to be edited by this panel.wiggles- The wiggles of the object to be edited by this panel.gridx- The x position of the subpanel.gridy- The y position of the subpanel.
-
addWigglePanel
public final void addWigglePanel(int amp, int gridx, int gridy) Adds a wiggle panel for a group at the given position.- Specified by:
addWigglePanelin interfaceJaxoObjectEditPanel- Parameters:
amp- The amplitude of the object to be edited by this panel.gridx- The x position of the subpanel.gridy- The y position of the subpanel.
-
addSymmPanel
public final void addSymmPanel(boolean symm, int gridx, int gridy) Adds a symmetry panel for a photon line at the given position.- Specified by:
addSymmPanelin interfaceJaxoObjectEditPanel- Parameters:
symm- The symmetry of the object to be edited by this panel.gridx- The x position of the subpanel.gridy- The y position of the subpanel.
-
addStretchingPanel
public final void addStretchingPanel(boolean noFreqStretching, int gridx, int gridy) Adds a stretching panel for a photon bezier at the given position.- Specified by:
addStretchingPanelin interfaceJaxoObjectEditPanel- Parameters:
noFreqStretching- The stretching parameter of the object to be edited by this panel.gridx- The x position of the subpanel.gridy- The y position of the subpanel.
-
addRotationPanel
public final void addRotationPanel(int angle, int gridx, int gridy) Adds a rotation panel for a vertex at the given position.- Specified by:
addRotationPanelin interfaceJaxoObjectEditPanel- Parameters:
angle- The rotation angle of the object to be edited by this panel.gridx- The x position of the subpanel.gridy- The y position of the subpanel.
-
addArrowPanel
public final void addArrowPanel(boolean arrow, boolean flip, float oldPosition, int gridx, int gridy) Adds an arrow panel for an object at the given position.- Specified by:
addArrowPanelin interfaceJaxoObjectEditPanel- Parameters:
arrow- The arrow of the object to be edited by this panel.flip- The flip of the arrow.oldPosition- The old position of the Arrowgridx- The x position of the subpanel.gridy- The y position of the subpanel.
-
addArrowOptionsEditPanel
Adds an edit panel for an arrow at the given position. If the arrow does not provide an edit panel, ie ifJaxoArrow.getEditPanel()returns null, then nothing happens.- Specified by:
addArrowOptionsEditPanelin interfaceJaxoObjectEditPanel- Parameters:
arrow- The arrow to be edited.gridx- The x position of the subpanel.gridy- The y position of the subpanel.
-
addDoubleLinePanel
public final void addDoubleLinePanel(boolean dLine, float dlSep, int gridx, int gridy) Adds a double line panel for an object at the given position.- Specified by:
addDoubleLinePanelin interfaceJaxoObjectEditPanel- Parameters:
dLine- The doubleLine of the object to be edited by this panel.dlSep- The double line separation of the object to be edited by this panel.gridx- The x position of the subpanel.gridy- The y position of the subpanel.
-
addLineColorPanel
Adds a line color panel at the given position.- Specified by:
addLineColorPanelin interfaceJaxoObjectEditPanel- Parameters:
color- The color of the object to be edited by this panel.gridx- The x position of the subpanel.gridy- The y position of the subpanel.
-
addFillLineColorPanels
public final void addFillLineColorPanels(Color color, Color fillColor, boolean isFilled, int fillX, int fillY, int lineX, int lineY) Adds a fill and a line color panel at the given positions. The line panel will be disabled (dynamically) based on the fill color/grayscale.- Specified by:
addFillLineColorPanelsin interfaceJaxoObjectEditPanel- Parameters:
color- The color of the object to be edited by this panel.fillColor- The fill color of the object.isFilled- Whether the object is filled.fillX- The x position of the fill subpanel.fillY- The y position of the fill subpanel.lineX- The x position of the line subpanel.lineY- The y position of the line subpanel.
-
addColorPanel
Adds a color panel at the given position.- Specified by:
addColorPanelin interfaceJaxoObjectEditPanel- Parameters:
color- The color of the object to be edited by this panel.type- The color mode. Should be one ofJaxoObjectEditPanel.TYPE_COLOR,JaxoObjectEditPanel.TYPE_LINE_COLORorJaxoObjectEditPanel.TYPE_FILL_COLOR.gridx- The x position of the subpanel.gridy- The y position of the subpanel.
-
addTextPanel
Adds a text edit panel at the given position.- Specified by:
addTextPanelin interfaceJaxoObjectEditPanel- Parameters:
text- The text object to be edited by this panel.gridx- The x position of the subpanel.gridy- The y position of the subpanel.
-
addPSFontPanel
Adds a postscript text font edit panel at the given position.- Specified by:
addPSFontPanelin interfaceJaxoObjectEditPanel- Parameters:
font- The font of the text to be edited by this panel.gridx- The x position of the subpanel.gridy- The y position of the subpanel.gridwidth- The width of the subpanel.
-
addLatexAlignPanel
public final void addLatexAlignPanel(int allign, int gridx, int gridy) Adds a latex align edit panel at the given position.- Specified by:
addLatexAlignPanelin interfaceJaxoObjectEditPanel- Parameters:
allign- The align property of the text to be edited by this panel.gridx- The x position of the subpanel.gridy- The y position of the subpanel.
-
addLatexFontSizePanel
public final void addLatexFontSizePanel(int size, int gridx, int gridy) Adds a latex font size edit panel at the given position.- Specified by:
addLatexFontSizePanelin interfaceJaxoObjectEditPanel- Parameters:
size- The text size of the text to be edited by this panel.gridx- The x position of the subpanel.gridy- The y position of the subpanel.
-
show
Display the EditPanel for the current object.- Specified by:
showin interfaceJaxoObjectEditPanel- Parameters:
parent- The parent component for the edit panel windowl- The location for for the edit panel window
-
hasChanged
public boolean hasChanged()Determines wether the object has been modified.- Specified by:
hasChangedin interfaceJaxoObjectEditPanel- Returns:
- True if the object has been modified.
-
setTitleAndIcon
Set title (message key) and icon (filename) that are displayed in the dialog.- Specified by:
setTitleAndIconin interfaceJaxoObjectEditPanel- Parameters:
newTitle- the title.newIcon- the icon.
-
resetObject
protected void resetObject()Reset 'object' (and GUI) to initial value. -
showDialog
-