Groovy Documentation

eu.hansolo.custom
[Java] Class Note

java.lang.Object
  java.awt.Component
      java.awt.Container
          javax.swing.JComponent
              eu.hansolo.custom.Note

public final class Note
extends JComponent

Authors:
Gerrit Grunwald


Field Summary
private Point2D CENTER

private ComponentListener COMPONENT_LISTENER

private Rectangle INNER_BOUNDS

static String TEXT_PROPERTY

private Font customFont

private boolean customFontEnabled

private Font handwritingFont

private boolean handwritingFontEnabled

private Color noteColor

private BufferedImage noteImage

private JEditorPane notePane

private PropertyChangeSupport propertySupport

private BufferedImage pushPinImage

private boolean pushPinVisible

private boolean square

private Font textFont

 
Fields inherited from class JComponent
WHEN_FOCUSED, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_IN_FOCUSED_WINDOW, UNDEFINED_CONDITION, TOOL_TIP_TEXT_KEY, TOP_ALIGNMENT, CENTER_ALIGNMENT, BOTTOM_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, WIDTH, HEIGHT, PROPERTIES, SOMEBITS, FRAMEBITS, ALLBITS, ERROR, ABORT
 
Fields inherited from class Container
TOP_ALIGNMENT, CENTER_ALIGNMENT, BOTTOM_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, WIDTH, HEIGHT, PROPERTIES, SOMEBITS, FRAMEBITS, ALLBITS, ERROR, ABORT
 
Constructor Summary
Note()

 
Method Summary
void addPropertyChangeListener(PropertyChangeListener LISTENER)

private void calcInnerBounds()

Calculates the area that is available for painting the display

private BufferedImage createImage(int WIDTH, int HEIGHT, int TRANSPARENCY)

Returns a compatible image of the given size and transparency

BufferedImage createNoteImage(int WIDTH, int HEIGHT)

BufferedImage createPushPinImage(int WIDTH, int HEIGHT)

Font getCustomFont()

private Rectangle getInnerBounds()

Returns a rectangle representing the available space for drawing the component taking the insets into account (e.g. given through borders etc.)

Dimension getMinimumSize()

Color getNoteColor()

String getText()

Color getTextColor()

void init(int WIDTH, int HEIGHT)

boolean isCustomFontEnabled()

boolean isHandwritingFontEnabled()

boolean isPushPinVisible()

protected void paintComponent(Graphics g)

void removePropertyChangeListener(PropertyChangeListener LISTENER)

void setBounds(Rectangle BOUNDS)

void setBounds(int X, int Y, int WIDTH, int HEIGHT)

void setCustomFont(Font CUSTOM_FONT)

void setCustomFontEnabled(boolean CUSTOM_FONT_ENABLED)

void setHandwritingFontEnabled(boolean HANDWRITING_FONT_ENABLED)

void setNoteColor(Color NOTE_COLOR)

void setPreferredSize(Dimension DIM)

void setPushPinVisible(boolean PUSHPIN_VISIBLE)

void setSize(int WIDTH, int HEIGHT)

void setSize(Dimension DIM)

void setText(String TEXT)

void setTextColor(Color TEXT_COLOR)

String toString()

 
Methods inherited from class JComponent
contains, getLocation, print, getSize, isOpaque, enable, disable, update, getY, getX, getInsets, getInsets, setFont, getPreferredSize, getMinimumSize, getMaximumSize, getAlignmentX, getAlignmentY, paint, getListeners, addNotify, removeNotify, setFocusTraversalKeys, requestFocus, requestFocus, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, setEnabled, isDoubleBuffered, setVisible, setForeground, setBackground, getBounds, reshape, getWidth, getHeight, setPreferredSize, setMinimumSize, setMaximumSize, getBaseline, getBaselineResizeBehavior, getGraphics, getFontMetrics, repaint, repaint, printAll, requestFocusInWindow, updateUI, getUIClassID, addAncestorListener, setInheritsPopupMenu, getInheritsPopupMenu, setComponentPopupMenu, getComponentPopupMenu, isPaintingTile, isPaintingForPrint, isManagingFocus, setNextFocusableComponent, getNextFocusableComponent, setRequestFocusEnabled, isRequestFocusEnabled, grabFocus, setVerifyInputWhenFocusTarget, getVerifyInputWhenFocusTarget, setBorder, getBorder, setAlignmentY, setAlignmentX, setInputVerifier, getInputVerifier, setDebugGraphicsOptions, getDebugGraphicsOptions, registerKeyboardAction, registerKeyboardAction, unregisterKeyboardAction, getRegisteredKeyStrokes, getConditionForKeyStroke, getActionForKeyStroke, resetKeyboardActions, setInputMap, getInputMap, getInputMap, setActionMap, getActionMap, requestDefaultFocus, getDefaultLocale, setDefaultLocale, setToolTipText, getToolTipText, getToolTipText, getToolTipLocation, getPopupLocation, createToolTip, scrollRectToVisible, setAutoscrolls, getAutoscrolls, setTransferHandler, getTransferHandler, getClientProperty, putClientProperty, isLightweightComponent, setOpaque, computeVisibleRect, getVisibleRect, addVetoableChangeListener, removeVetoableChangeListener, getVetoableChangeListeners, getTopLevelAncestor, removeAncestorListener, getAncestorListeners, revalidate, isValidateRoot, isOptimizedDrawingEnabled, paintImmediately, paintImmediately, setDoubleBuffered, getRootPane, add, add, add, add, add, remove, remove, list, list, removeAll, getComponent, invalidate, validate, getComponentCount, countComponents, getComponents, insets, setComponentZOrder, getComponentZOrder, getLayout, setLayout, doLayout, layout, preferredSize, minimumSize, paintComponents, printComponents, addContainerListener, removeContainerListener, getContainerListeners, deliverEvent, getComponentAt, getComponentAt, locate, getMousePosition, findComponentAt, findComponentAt, isAncestorOf, getFocusTraversalKeys, areFocusTraversalKeysSet, isFocusCycleRoot, isFocusCycleRoot, transferFocusBackward, setFocusTraversalPolicy, getFocusTraversalPolicy, isFocusTraversalPolicySet, setFocusCycleRoot, setFocusTraversalPolicyProvider, isFocusTraversalPolicyProvider, transferFocusDownCycle, applyComponentOrientation, addPropertyChangeListener, addPropertyChangeListener, add, toString, getName, contains, size, getParent, getLocation, remove, setName, list, list, list, getSize, resize, resize, setSize, setSize, enable, location, isValid, setLocale, action, getMousePosition, getGraphicsConfiguration, dispatchEvent, isVisible, isEnabled, isDisplayable, isFocusable, getTreeLock, isLightweight, getPeer, isFocusOwner, transferFocus, getFont, isPreferredSizeSet, isMinimumSizeSet, isMaximumSizeSet, isShowing, handleEvent, postEvent, getFocusCycleRootAncestor, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, setDropTarget, getDropTarget, getToolkit, enableInputMethods, show, show, hide, getForeground, isForegroundSet, getBackground, isBackgroundSet, isFontSet, getLocale, getColorModel, getLocationOnScreen, setLocation, setLocation, move, getBounds, bounds, setBounds, setBounds, setCursor, getCursor, isCursorSet, paintAll, repaint, repaint, repaint, imageUpdate, createImage, createImage, createVolatileImage, createVolatileImage, prepareImage, prepareImage, checkImage, checkImage, setIgnoreRepaint, getIgnoreRepaint, inside, addComponentListener, removeComponentListener, getComponentListeners, addFocusListener, removeFocusListener, getFocusListeners, addHierarchyListener, removeHierarchyListener, getHierarchyListeners, addHierarchyBoundsListener, removeHierarchyBoundsListener, getHierarchyBoundsListeners, addKeyListener, removeKeyListener, getKeyListeners, addMouseListener, removeMouseListener, getMouseListeners, addMouseMotionListener, removeMouseMotionListener, getMouseMotionListeners, addMouseWheelListener, removeMouseWheelListener, getMouseWheelListeners, addInputMethodListener, removeInputMethodListener, getInputMethodListeners, getInputMethodRequests, getInputContext, mouseDown, mouseDrag, mouseUp, mouseMove, mouseEnter, mouseExit, keyDown, keyUp, gotFocus, lostFocus, isFocusTraversable, setFocusable, setFocusTraversalKeysEnabled, getFocusTraversalKeysEnabled, nextFocus, transferFocusUpCycle, hasFocus, removePropertyChangeListener, removePropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, setComponentOrientation, getComponentOrientation, wait, wait, wait, equals, hashCode, getClass, notify, notifyAll
 
Methods inherited from class Container
add, add, add, add, add, remove, remove, list, list, print, removeAll, update, getComponent, invalidate, validate, getComponentCount, countComponents, getComponents, getInsets, insets, setComponentZOrder, getComponentZOrder, getLayout, setLayout, doLayout, layout, setFont, getPreferredSize, preferredSize, getMinimumSize, minimumSize, getMaximumSize, getAlignmentX, getAlignmentY, paint, paintComponents, printComponents, addContainerListener, removeContainerListener, getContainerListeners, getListeners, deliverEvent, getComponentAt, getComponentAt, locate, getMousePosition, findComponentAt, findComponentAt, addNotify, removeNotify, isAncestorOf, setFocusTraversalKeys, getFocusTraversalKeys, areFocusTraversalKeysSet, isFocusCycleRoot, isFocusCycleRoot, transferFocusBackward, setFocusTraversalPolicy, getFocusTraversalPolicy, isFocusTraversalPolicySet, setFocusCycleRoot, setFocusTraversalPolicyProvider, isFocusTraversalPolicyProvider, transferFocusDownCycle, applyComponentOrientation, addPropertyChangeListener, addPropertyChangeListener, add, toString, getName, contains, contains, size, getParent, getLocation, getLocation, remove, setName, list, list, list, getSize, getSize, resize, resize, setSize, setSize, isOpaque, enable, enable, disable, location, isValid, setLocale, getY, getX, action, getMousePosition, getGraphicsConfiguration, dispatchEvent, isVisible, isEnabled, isDisplayable, isFocusable, getTreeLock, isLightweight, getPeer, isFocusOwner, transferFocus, getFont, isPreferredSizeSet, isMinimumSizeSet, isMaximumSizeSet, isShowing, handleEvent, postEvent, getFocusCycleRootAncestor, requestFocus, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, setDropTarget, getDropTarget, getToolkit, setEnabled, isDoubleBuffered, enableInputMethods, setVisible, show, show, hide, getForeground, setForeground, isForegroundSet, getBackground, setBackground, isBackgroundSet, isFontSet, getLocale, getColorModel, getLocationOnScreen, setLocation, setLocation, move, getBounds, getBounds, bounds, setBounds, setBounds, reshape, getWidth, getHeight, setPreferredSize, setMinimumSize, setMaximumSize, getBaseline, getBaselineResizeBehavior, getGraphics, getFontMetrics, setCursor, getCursor, isCursorSet, paintAll, repaint, repaint, repaint, repaint, printAll, imageUpdate, createImage, createImage, createVolatileImage, createVolatileImage, prepareImage, prepareImage, checkImage, checkImage, setIgnoreRepaint, getIgnoreRepaint, inside, addComponentListener, removeComponentListener, getComponentListeners, addFocusListener, removeFocusListener, getFocusListeners, addHierarchyListener, removeHierarchyListener, getHierarchyListeners, addHierarchyBoundsListener, removeHierarchyBoundsListener, getHierarchyBoundsListeners, addKeyListener, removeKeyListener, getKeyListeners, addMouseListener, removeMouseListener, getMouseListeners, addMouseMotionListener, removeMouseMotionListener, getMouseMotionListeners, addMouseWheelListener, removeMouseWheelListener, getMouseWheelListeners, addInputMethodListener, removeInputMethodListener, getInputMethodListeners, getInputMethodRequests, getInputContext, mouseDown, mouseDrag, mouseUp, mouseMove, mouseEnter, mouseExit, keyDown, keyUp, gotFocus, lostFocus, isFocusTraversable, setFocusable, setFocusTraversalKeysEnabled, getFocusTraversalKeysEnabled, requestFocusInWindow, nextFocus, transferFocusUpCycle, hasFocus, removePropertyChangeListener, removePropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, setComponentOrientation, getComponentOrientation, wait, wait, wait, equals, hashCode, getClass, notify, notifyAll
 

Field Detail

CENTER

private final Point2D CENTER


COMPONENT_LISTENER

private final ComponentListener COMPONENT_LISTENER


INNER_BOUNDS

private final Rectangle INNER_BOUNDS


TEXT_PROPERTY

public static final String TEXT_PROPERTY


customFont

private Font customFont


customFontEnabled

private boolean customFontEnabled


handwritingFont

private Font handwritingFont


handwritingFontEnabled

private boolean handwritingFontEnabled


noteColor

private Color noteColor


noteImage

private BufferedImage noteImage


notePane

private JEditorPane notePane


propertySupport

private PropertyChangeSupport propertySupport


pushPinImage

private BufferedImage pushPinImage


pushPinVisible

private boolean pushPinVisible


square

private boolean square


textFont

private Font textFont


 
Constructor Detail

Note

public Note()


 
Method Detail

addPropertyChangeListener

@Override
public void addPropertyChangeListener(PropertyChangeListener LISTENER)


calcInnerBounds

private void calcInnerBounds()
Calculates the area that is available for painting the display


createImage

private BufferedImage createImage(int WIDTH, int HEIGHT, int TRANSPARENCY)
Returns a compatible image of the given size and transparency
Parameters:
WIDTH
HEIGHT
TRANSPARENCY
Returns:
a compatible image of the given size and transparency


createNoteImage

public BufferedImage createNoteImage(int WIDTH, int HEIGHT)


createPushPinImage

public BufferedImage createPushPinImage(int WIDTH, int HEIGHT)


getCustomFont

public Font getCustomFont()


getInnerBounds

private Rectangle getInnerBounds()
Returns a rectangle representing the available space for drawing the component taking the insets into account (e.g. given through borders etc.)
Returns:
a rectangle that represents the area available for rendering the component


getMinimumSize

@Override
public Dimension getMinimumSize()


getNoteColor

public Color getNoteColor()


getText

public String getText()


getTextColor

public Color getTextColor()


init

public final void init(int WIDTH, int HEIGHT)


isCustomFontEnabled

public boolean isCustomFontEnabled()


isHandwritingFontEnabled

public boolean isHandwritingFontEnabled()


isPushPinVisible

public boolean isPushPinVisible()


paintComponent

@Override
protected void paintComponent(Graphics g)


removePropertyChangeListener

@Override
public void removePropertyChangeListener(PropertyChangeListener LISTENER)


setBounds

de
	public
public void setBounds(Rectangle BOUNDS)


setBounds

de
	public
public void setBounds(int X, int Y, int WIDTH, int HEIGHT)


setCustomFont

public void setCustomFont(Font CUSTOM_FONT)


setCustomFontEnabled

public void setCustomFontEnabled(boolean CUSTOM_FONT_ENABLED)


setHandwritingFontEnabled

public void setHandwritingFontEnabled(boolean HANDWRITING_FONT_ENABLED)


setNoteColor

public void setNoteColor(Color NOTE_COLOR)


setPreferredSize

de
	public
public void setPreferredSize(Dimension DIM)


setPushPinVisible

public void setPushPinVisible(boolean PUSHPIN_VISIBLE)


setSize

de
	public
public void setSize(int WIDTH, int HEIGHT)


setSize

de
	public
public void setSize(Dimension DIM)


setText

public void setText(String TEXT)


setTextColor

public void setTextColor(Color TEXT_COLOR)


toString

de
	public
public String toString()


 

Groovy Documentation