public class Comment
extends javax.swing.JPanel
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW| Constructor and Description |
|---|
Comment(Workspace workspace,
java.lang.String initText,
CommentSource source,
java.awt.Color borderColor,
double zoom)
Constructs a Comment
with belonging to source, with text of initText, and initial zoom
The comment's borders will have the color borderColor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
delete()
Handle the removal of this comment from its comment source
|
CommentArrow |
getArrow()
access to the comment arrow object
|
int |
getCommentLabelWidth()
Returns the width of the comment label for this comment
|
org.w3c.dom.Node |
getSaveNode(org.w3c.dom.Document document)
Returns the node for this comment.
|
java.lang.String |
getText() |
boolean |
isConstrainComment()
returns whether this comment should be constrained to its parent's bounds
|
static Comment |
loadComment(Workspace workspace,
org.w3c.dom.NodeList commentChildren,
RenderableBlock rb)
Loads the comment from a NodeList of comment parts
|
void |
paint(java.awt.Graphics g)
overrides javax.Swing.JPanel.paint()
|
void |
reformComment()
Recalculate the shape of this comment
|
void |
setConstrainComment(boolean constrainComment)
sets whether this comment should be constrained to its parent's bounds
|
void |
setLocation(int x,
int y)
moves this to a new position at (x,y) but not outside of its parent Container
|
void |
setLocation(java.awt.Point p)
moves this to a new position at (x,y) but not outside of its parent Container
|
void |
setParent(java.awt.Container newparent)
Moves this comment from it's old parent Container to
a new Container.
|
void |
setParent(java.awt.Container newparent,
java.lang.Object constraints)
Moves this comment from it's old parent Container to
a new Container with given constrain.
|
void |
setText(java.lang.String text) |
void |
setVisible(boolean b)
Over rides the standard setVisible to make sure the arrow's visibility is also set.
|
void |
setZoomLevel(double newZoom)
Set a new zoom level, changes font size, label size, location, shape of comment, and arrow for this comment
|
void |
showOnTop()
Bumps the comment to top of ZOrder of parent if parent exists
|
java.lang.String |
toString()
String representation of this
|
void |
translatePosition(int dx,
int dy) |
void |
update()
Updates the comment and commentLabel
|
void |
update(boolean visibleState)
Sets the active state of the commentLabel and updates the comment and commentLabel
|
getAccessibleContext, getUI, getUIClassID, setUI, updateUIaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, 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, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, 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, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, updateadd, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validateaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, 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, 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, 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, setName, setSize, setSize, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCyclepublic Comment(Workspace workspace, java.lang.String initText, CommentSource source, java.awt.Color borderColor, double zoom)
workspace - The workspace in useinitText - initial text of commentsource - where the comment is linked to.borderColor - the color that the border of the comment should bezoom - initial zoompublic void delete()
public int getCommentLabelWidth()
public void update()
public void update(boolean visibleState)
visibleState - public void setZoomLevel(double newZoom)
newZoom - public void reformComment()
public org.w3c.dom.Node getSaveNode(org.w3c.dom.Document document)
public static Comment loadComment(Workspace workspace, org.w3c.dom.NodeList commentChildren, RenderableBlock rb)
workspace - The workspace in usecommentChildren - rb - public void paint(java.awt.Graphics g)
paint in class javax.swing.JComponentpublic java.lang.String getText()
public void setText(java.lang.String text)
text - public void setLocation(int x,
int y)
setLocation in class java.awt.Componentpublic void setLocation(java.awt.Point p)
setLocation in class java.awt.Componentpublic void translatePosition(int dx,
int dy)
dx - dy - public void setParent(java.awt.Container newparent)
newparent - public void setVisible(boolean b)
setVisible in class javax.swing.JComponentpublic void setParent(java.awt.Container newparent,
java.lang.Object constraints)
newparent - constraints - public java.lang.String toString()
toString in class java.awt.Componentpublic void showOnTop()
public CommentArrow getArrow()
public boolean isConstrainComment()
public void setConstrainComment(boolean constrainComment)
constrainComment - the constrainComment to set