|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
ARoad0.Gui2.GraphicView
ARoad0.Gui2.GraphicNoThanView
public class GraphicNoThanView
This class is responsible for displaying a set of Sources and one access Target, and to show if all the rights of all the sources on this target are above or not a No-More-Than right criterion, and below or not a No-Less-Than right criterion. Using StringRight.compareTo() between the rights, the right internal key is the first compared property if the rights have the same sens. Thus, this method may detect the criterion right is not fulfilled while the effective right has no direct path to the criterion right, in the network of rights. This is a defensive behavior, which may be considered too restrictive in some cases. On the other hand, the Access Road user gets the effective right in the 'See why' text. He may so decide the gravity to get no fulfillment.
The target is displayed at the top of the view. It is processed as another BaseObject to show in a GraphicNode, as usual for GraphicViews. If it is null, the criteria rights are not displayed. The two criteria rights use two GraphicTexts to switch the color between green and red, following the result of each rights analysis.
This class overrides some GraphicView methods: resetGraphicView(), drawArrowsAndRights(). It overrides several methods of its parent GraphicEPRView: initialize(), buildUpArrowsAndRights(), setGraphicNodes(), resetRights(), setWhyText().
It has some specific methods for allowing its GraphicViewListener to detect any change in the criteria states. This is used for instance to update the frame icon of the GraphicNoThanView frame. It has also a specific method to detect when an Source has an excluded Source, to draw this Source node in gray rather than in blue. See the superclass GraphicView to understand this class.
NoThanViewInBaseImpl
,
GraphicView
,
GraphicEPRView
,
Serialized FormNested 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 | |
---|---|
protected static java.awt.geom.Point2D.Float |
ARROW_END
|
protected static java.awt.geom.Point2D.Float |
ARROW_START
|
protected static int |
ARROW_WIDTH_SHIFT
|
protected static int |
EP_ORIGINE_HEIGHT
|
protected static int |
EP_ORIGINE_WIDTH
|
protected GraphicText |
lessCriterion_
The GraphicText which displays the less criterion right in green or red. |
protected GraphicText |
moreCriterion_
The GraphicText which displays the more criterion right in green or red. |
protected static java.lang.String |
NO_LESS_RIGHT_GRAPHICTEXT_BOUNDS_KEY
The key in GraphicView.m_GraphicNodesBounds_ for the GraphicText of the no-less-than right. |
protected static java.lang.String |
NO_MORE_RIGHT_GRAPHICTEXT_BOUNDS_KEY
The key in GraphicView.m_GraphicNodesBounds_ for the GraphicText of the no-more-than right. |
protected static int |
RIGHTS_ORIGINE_HEIGTH
|
protected static int |
RIGHTS_ORIGINE_WIDTH
|
protected static int |
TARGET_ORIGINE_HEIGTH
|
protected static int |
TARGET_ORIGINE_WIDTH
|
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 | |
---|---|
GraphicNoThanView()
This constructor is only for the subclasses, if any. |
|
GraphicNoThanView(NoThanViewInBase _view,
java.util.Map _m_positionIndex)
This constructor adds all the _view objects in this panel, each associated to a GraphicNode. |
Method Summary | |
---|---|
protected java.lang.Object[] |
buildUpArrowsAndRights(java.util.Map _m_l_DisplayableLinks,
java.util.Map _m_gNodeBoundsModel)
Build up the links and rights to put in l_LinksAndRights_, to be painted by GraphicView.drawArrowsAndRights(). |
protected void |
drawArrowsAndRights(java.awt.Graphics2D _g2)
Draws the single arrow, the comments and rights with BeamerManager.plainFont from the values in l_LinksAndRights_ and l_currentArrowsAndRightsStarts_. |
void |
finalizeForGui()
Invoked by resetGraphicView() and ViewTreeBaseListenerImpl to finalize the instance and set is a a new object before the initialization, with the exception of whyText_ that is set to null to indicate the finalizing operation. |
private java.awt.Point[] |
getGraphicNodesPositionsForSources()
Gets an array of 9-positions for the layout of the GraphicNoThanView Eligible Parties, with their coordinates from the GraphicView origine point. |
protected void |
initialize()
Initializes nodesNumber_ (not used in this clss), m_l_DisplayableLinks_, l_allNodesInLinks_, nodesNumber_, moreCriterion_ and lessCrietria_ and set the GraphicNodes locations. |
boolean |
isGreenForLess()
The green color for the drawn text is InternalFrame.FORECOLOR_3, else it is a red color: InternalFrame.FORECOLOR_4. |
boolean |
isGreenForMore()
The green color for the drawn text is InternalFrame.FORECOLOR_3, else it is a red color: InternalFrame.FORECOLOR_4. |
protected boolean |
isReducedSource(ImmutableSource _sour)
Called by GraphicGroup, GraphicAccount, GraphicActor. |
void |
mouseReleased(java.awt.event.MouseEvent _e)
No operation in any case. |
protected void |
resetCriteria(java.util.Map _m_l_DisplayableLinks)
Sets the criterion right and the green/red color on each right criteria. |
void |
resetRights()
Draws the two right colors after a change in the rights, without changing in GraphicNodes and the arrow. |
protected void |
setGraphicNodeLocations(ImmutableName _newNodeName,
java.util.Map _m_GraphicNodesPosition)
Called only by resetGraphicView(). |
protected void |
setGraphicNodes()
The GraphicNodes there are for the target and the sources, but not for the GraphicTexts which are updated with the rights. |
void |
setRightsRelatedBaseObjects(java.util.HashSet _l_baseObjects)
These BaseObjects are provided by the gWork classes, and cannot be view objects. |
javax.swing.JTextPane |
setWhyText()
Provides the comments that the program generates in this method to explain the view rights. |
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, 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, setForeground, 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, processComponentEvent, 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 |
Field Detail |
---|
protected GraphicText moreCriterion_
protected GraphicText lessCriterion_
protected static final java.lang.String NO_MORE_RIGHT_GRAPHICTEXT_BOUNDS_KEY
protected static final java.lang.String NO_LESS_RIGHT_GRAPHICTEXT_BOUNDS_KEY
protected static final int EP_ORIGINE_WIDTH
protected static final int EP_ORIGINE_HEIGHT
protected static final int TARGET_ORIGINE_WIDTH
protected static final int TARGET_ORIGINE_HEIGTH
protected static java.awt.geom.Point2D.Float ARROW_END
protected static final java.awt.geom.Point2D.Float ARROW_START
protected static final int ARROW_WIDTH_SHIFT
protected static final int RIGHTS_ORIGINE_WIDTH
protected static final int RIGHTS_ORIGINE_HEIGTH
Constructor Detail |
---|
public GraphicNoThanView()
public GraphicNoThanView(NoThanViewInBase _view, java.util.Map _m_positionIndex) throws ProcessError, java.lang.InterruptedException
_view
- NoThanViewInBase to associate to this instance._m_positionIndex
- is the map (name, Integer) returned
by getIndexesOfNodeLocations() at the previous view opening. May be null.
ProcessError
- if there is a loop in the rights searching
java.lang.InterruptedException
Method Detail |
---|
public final boolean isGreenForMore()
public final boolean isGreenForLess()
public final javax.swing.JTextPane setWhyText()
setWhyText
in class GraphicView
public void mouseReleased(java.awt.event.MouseEvent _e)
mouseReleased
in interface java.awt.event.MouseListener
mouseReleased
in class GraphicView
_e
- is the eventpublic final void resetRights() throws ProcessError, java.lang.InterruptedException
This class is designed to be updated, as any JComponent, by the event dispatch thread for most of the operations, but it allows the rights updating in a worker thread, through the call of this method.
Called in a worker thread by GraphicViewBaseListener.changeTabView() and changeFrameView(), GraphicViewPropertyEditor.propertyChange(). Calls RightsFactory_Facade.detectNoThanRights(). This method must be followed by a call to repaint() in the event dispatch thread. Overrides the super method.
resetRights
in class GraphicView
ProcessError
- if there is a loop in the rights search
java.lang.InterruptedException
public final void setRightsRelatedBaseObjects(java.util.HashSet _l_baseObjects)
setRightsRelatedBaseObjects
in class GraphicView
_l_baseObjects
- BaseObject set. May be null.public final void finalizeForGui()
finalizeForGui
in class GraphicView
protected final java.lang.Object[] buildUpArrowsAndRights(java.util.Map _m_l_DisplayableLinks, java.util.Map _m_gNodeBoundsModel)
buildUpArrowsAndRights
in class GraphicView
_m_l_DisplayableLinks
- is the map of DisplayableLinks lists (one per pair)
associated to the view._m_gNodeBoundsModel
- is the map of the node bounds for the shapes
in the GraphicNoThanView. No use there.
protected final void setGraphicNodeLocations(ImmutableName _newNodeName, java.util.Map _m_GraphicNodesPosition)
setGraphicNodeLocations
in class GraphicView
_newNodeName
- name of the base object to add. May be null._m_GraphicNodesPosition
- is the map of the old locations. May be empty.protected final void resetCriteria(java.util.Map _m_l_DisplayableLinks)
_m_l_DisplayableLinks
- is the map of DisplayableLinks lists (one per pair)
associated to the view. If empty, the colors are green.protected final void initialize() throws ProcessError, java.lang.InterruptedException
initialize
in class GraphicView
InterruptedException,
- ProcessError if there is a loop in the rights search
ProcessError
java.lang.InterruptedException
protected final void setGraphicNodes()
setGraphicNodes
in class GraphicView
protected final boolean isReducedSource(ImmutableSource _sour)
_sour
- an access source
protected final void drawArrowsAndRights(java.awt.Graphics2D _g2)
drawArrowsAndRights
in class GraphicView
_g2
- is the Graphics2D to drawprivate final java.awt.Point[] getGraphicNodesPositionsForSources()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |