|
||||||||||
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.GraphicEPRView
public class GraphicEPRView
This class is responsible for displaying an EPRViewInBase and its graphical objects (nodes, links, arrows, rights) in the desktop. The BaseObjects map is a map of (Source, Target) pairs, that is in fact (EligibleParty/VirtualFolder, Resource/VirtualFolder) pairs, and the GraphicNodes are GraphicAccount/Group/Resource/Actor/VirtualFolder. Study the parent GraphicView class for a good understanding of this class. Its subclasses are GraphicSketchView and GraphicNoThanView.
EPRViewInBaseImpl
,
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 | |
---|---|
private boolean |
detectAcl_
|
private boolean |
detectUserGroupLinks_
|
protected java.util.List |
l_AccessTargetSources_
After the search of the DisplayableLinkImpls, list of EligibleParties that are access targets for other Sources in viewInBase_. |
protected java.util.List |
l_NoSourceTargets_
List of Targets in viewInBase_ that are not ImmutableSources, then this is the list of Resources which are not EligibleParties. |
protected int |
noSourceTargetsCount_
l_NoSourceTargets_.size(). |
protected int |
sourcesCount_
number of Sources in viewInBase_ |
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 | |
---|---|
GraphicEPRView()
This constructor is only for the subclasses. |
|
GraphicEPRView(EPRViewInBase _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)
Sets the property l_LinksAndRights_ which contains the links and rights as Shapes, to be painted by drawArrowsAndRights() in this GraphicView.. |
void |
finalizeForGui()
Invoked by resetGraphicView() and ViewTreeBaseListenerImpl to finalize the instance and set it as a new object before the initialization. |
private static java.awt.Shape |
formRightsShape(java.awt.Graphics2D _g2,
java.lang.String _rights,
java.awt.geom.Point2D.Float _point)
NO USE. |
boolean |
hasFirstRateLinkInOneDLink(java.util.List _l_links)
Checks up if there is at most one DisplayableLink which has a first rate link as last AccessControlLink. |
boolean |
hasOwnerContainLinkToGroupIDMember(java.util.List _l_links)
Checks if there is at most one DisplayableLink which has all of its AccessControlLinks with a OWNER or CONTAIN relation. |
boolean |
hasStrengthenLinksInOneDLink(java.util.List _l_links)
Check if there is at most one DisplayableLink which has all of its AccessControlLinks with a strengthen relation (OWNER, HAS_MEMBER, HAS_CHILD, IS_ALIAS, RUN_UNDER). |
protected void |
initialize()
This central method is the main manager of the instance. |
void |
resetRights()
Draws the new arrows and rights after a change in the rights, without changing in GraphicNodes. |
protected static java.awt.geom.Line2D.Float |
setArrowHead(java.awt.geom.Point2D.Float _pointOne,
java.awt.geom.Point2D.Float _pointTwo,
boolean _aboveLine)
Sets each side of an arrow head as a Line2D at the right position. |
protected void |
setGraphicNodes()
Sets the GraphicNodes in a 16, 25, 49 or 100-positions layout in the JPanel, with their absolute coordinates. |
void |
setRightsRelatedBaseObjects(java.util.HashSet _l_baseObjects)
These BaseObjects are provided by the gWork classes, and cannot be view objects. |
javax.swing.JTextPane |
setWhyText()
This why text depends on the comments. |
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 java.util.List l_NoSourceTargets_
protected final java.util.List l_AccessTargetSources_
protected int noSourceTargetsCount_
protected int sourcesCount_
private boolean detectAcl_
private boolean detectUserGroupLinks_
Constructor Detail |
---|
public GraphicEPRView()
public GraphicEPRView(EPRViewInBase _view, java.util.Map _m_positionIndex) throws ProcessError
_view
- EPRViewInBase 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 searchingMethod Detail |
---|
protected void initialize() throws ProcessError, java.lang.InterruptedException
initialize
in class GraphicView
InterruptedException,
- ProcessError if there is a loop in the rights searching
ProcessError
java.lang.InterruptedException
protected void setGraphicNodes()
setGraphicNodes
in class GraphicView
public final javax.swing.JTextPane setWhyText()
setWhyText
in class GraphicView
public void finalizeForGui()
finalizeForGui
in class GraphicView
protected java.lang.Object[] buildUpArrowsAndRights(java.util.Map _m_l_DisplayableLinks, java.util.Map _m_gNodeBoundsModel)
There are 4 elements for each typical arrow: 3 for the arrow and 1 text for the description, which are often the rights to display.
The strengthen path is associated to a strengthen relation including the OWNER, HAS_MEMBER, HAS_CHILD, IS_ALIAS, RUN_UNDER links. When it is a strengthen relation in the last link between 2 GroupIDMembers, to draw a line and not an arrow, there is one element for a line, two empty elements, and one text for the comments and rights.
Otherwise, there are plain arrows, but not from a starting node with a dashed_stroke arrow to show that this link is weak (marked by a 'WEAK' property of the first link).
The first-rate path is associated to a direct path which is superior to the other indirect paths between the two nodes, and its arrow is drawn with a larger width.
In GraphicSketchView, when a BaseObject is drawn twice in the graphic view, the second node is put on the bottom line of the access targets, and its key in m_GraphicNodes_ and m_GraphicNodesBounds_ is its name extended by ''.
This method selects only the first DisplayableLinkImpl to get the two ends, and to call link.getEorLastLink().getActivatedStrengthenTypes() and link.isWeak() The view Shapes and Strings are actually drawn in drawArrowsAndRights(). Called by the contructor, by resetRights() in this class and its subclass, and by the super class method GraphicView.mouseReleased(). Calls RightsFactory_Facade.getEffectiveRightsForPair(). Calls the super class method setPoint2DForArrowAndRights(), setArrowHead(). Synchronized on m_l_DisplayableLinks_. Puts the absolute positionning in l_currentArrowsAndRightsStarts_. Overridden by GraphicNoThanView, but not by GraphicSketchView. Overrides the GraphicView method.
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 GraphicEPRView.
public void resetRights() throws ProcessError, java.lang.InterruptedException
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 boolean hasStrengthenLinksInOneDLink(java.util.List _l_links)
_l_links
- list of DisplayableLinkImpl
public final boolean hasFirstRateLinkInOneDLink(java.util.List _l_links)
_l_links
- list of DisplayableLinkImpl
public final boolean hasOwnerContainLinkToGroupIDMember(java.util.List _l_links)
_l_links
- list of DisplayableLinkImpl
protected static final java.awt.geom.Line2D.Float setArrowHead(java.awt.geom.Point2D.Float _pointOne, java.awt.geom.Point2D.Float _pointTwo, boolean _aboveLine)
_pointOne
- starting point of the arrow_pointTwo
- ending point of the arrow_aboveLine
- true to set the superior side of the arrow head, else set
the inferior side
private static final java.awt.Shape formRightsShape(java.awt.Graphics2D _g2, java.lang.String _rights, java.awt.geom.Point2D.Float _point)
_g2
- _rights
- String._point
- Point2D.Float where the rights have to be drawn.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |