Package unifeat.gui.menu
Class DiagramPanel
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
unifeat.gui.menu.DiagramPanel
- All Implemented Interfaces:
ActionListener,MouseMotionListener,ImageObserver,MenuContainer,Serializable,EventListener,Accessible
This java class is used to create and show the 2-D diagrams of the input
values
- Author:
- Sina Tabakhi
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassThis java class is used to create a data structure for pair(key, val)in whichkeyandvalare Point data type.Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ArrayList<DiagramPanel.TupleValues>private final Color[](package private) JFrame(package private) JMenuprivate intprivate final int[]private final double[][]private int(package private) JMenuBar(package private) JMenuItem(package private) JMenuItem(package private) JMenuItemprivate intprivate final Stringprivate final Stringprivate final Stringprivate final Stringprivate final Stringprivate doubleprivate double(package private) JTextFieldprivate final intprivate final intprivate final intprivate final intprivate final intprivate final intprivate final intFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidThe listener method for receiving action events.private voidFinds the maximum value of the input arrayprivate voidFinds the minimum value of the input arrayprivate voidThis method sets an action for the mi_close button.private voidThis method sets an action for the mi_save button.private voidThis method sets an action for the mi_saveAs button.voidThe listener method for receiving mouse motion events on a component.voidThe listener method for receiving mouse motion events on a component.voidThis method is used to show the diagram.Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods 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, 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, 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 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, transferFocusDownCycle, validate, validateTreeMethods 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, 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
-
Field Details
-
f
JFrame f -
fileMenu
JMenu fileMenu -
mi_save
JMenuItem mi_save -
mi_saveAs
JMenuItem mi_saveAs -
mi_close
JMenuItem mi_close -
txt_info
JTextField txt_info -
PATH_PROJECT
-
LIST_ITERATION
private final double[][] LIST_ITERATION -
LIST_CASES
private final int[] LIST_CASES -
axisValues
-
NAME_MAIN_PANEL
-
NAME_DIAGRAM
-
NAME_Y_AXIS
-
NAME_LEGEND_LABEL
-
intervalYDimension
private int intervalYDimension -
maxValue
private int maxValue -
minValue
private int minValue -
tempMaxValue
private double tempMaxValue -
tempMinValue
private double tempMinValue -
X_DIMENSION_START
private final int X_DIMENSION_START- See Also:
-
X_DIMENSION_END
private final int X_DIMENSION_END- See Also:
-
Y_DIMENSION_START
private final int Y_DIMENSION_START- See Also:
-
Y_DIMENSION_END
private final int Y_DIMENSION_END- See Also:
-
WIDTH_LEGEND
private final int WIDTH_LEGEND- See Also:
-
X_D_START_LEGEND
private final int X_D_START_LEGEND- See Also:
-
Y_D_START_LEGEND
private final int Y_D_START_LEGEND- See Also:
-
COLOR_SET
-
-
Constructor Details
-
DiagramPanel
public DiagramPanel(double[][] arrayIteration, int[] arrayCases, String namePanel, String name, String nameY, String nameLegend, String path) Creates new form DiagramPanel. This method is called from within the constructor to initialize the form.- Parameters:
arrayIteration- the results of all iterationarrayCases- the all different casesnamePanel- the name of main panelname- the name of diagramnameY- the name of Y-axisnameLegend- the name of legendpath- the path of the workspace
-
-
Method Details
-
findMaxValue
private void findMaxValue()Finds the maximum value of the input array -
findMinValue
private void findMinValue()Finds the minimum value of the input array -
paintComponent
This method is used to show the diagram.- Overrides:
paintComponentin classJComponent- Parameters:
g- theGraphicscontext in which to paint
-
actionPerformed
The listener method for receiving action events. Invoked when an action occurs.- Specified by:
actionPerformedin interfaceActionListener- Parameters:
e- an action event
-
mi_saveActionPerformed
This method sets an action for the mi_save button.- Parameters:
e- an action event
-
mi_saveAsActionPerformed
This method sets an action for the mi_saveAs button.- Parameters:
e- an action event
-
mi_closeActionPerformed
This method sets an action for the mi_close button.- Parameters:
e- an action event
-
mouseDragged
The listener method for receiving mouse motion events on a component. Invoked when a mouse button is pressed on a component and then dragged.- Specified by:
mouseDraggedin interfaceMouseMotionListener- Parameters:
e- an action event
-
mouseMoved
The listener method for receiving mouse motion events on a component. Invoked when the mouse cursor has been moved onto a component but no buttons have been pushed.- Specified by:
mouseMovedin interfaceMouseMotionListener- Parameters:
e- an action event
-