org.formaria.svg
Class PopUpWindow

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by org.formaria.svg.PopUpWindow
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, TextHolder

public class PopUpWindow
extends javax.swing.JComponent
implements TextHolder

Copyright (c) Formaria Ltd., 2008, This software is licensed under the GNU Public License (GPL), please see license.txt for more details. If you make commercial use of this software you must purchase a commercial license from Formaria.

$Revision: 1.2 $

See Also:
Serialized Form

Nested Class Summary
 
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  java.lang.String captionStyle
           
protected  Project currentProject
           
protected  boolean first
           
protected  int fontSize
           
protected  double height
           
protected  double scale1
           
protected  double scale2
           
protected  double scale3
           
protected  double scale4
           
protected  double scale5
           
protected  double scale6
           
protected  double scale7
           
protected  double scale8
           
protected  java.awt.Stroke stroke
           
protected  java.lang.String text
           
protected  TextArea textArea
           
protected  double width
           
protected  double x
           
protected  double y
           
 
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
PopUpWindow()
          Creates a new instance of PopUpWindow
 
Method Summary
 int getFontSize()
          Returns the font size of the currently displayed text.
 java.lang.String getText()
          Returns the content currently displayed in the pop-up window.
 void paintComponent(java.awt.Graphics g)
          Paints the pop-up window within its parent component.
 void setBounds(int x1, int y1, int w1, int h1)
          Set the size of the pop-up window.
 void setFontSize(int fontSize)
          Sets the size of the font displayed in the pop-up window.
 void setFontSize(java.lang.String fontSize)
          Sets the size of the font displayed in the pop-up window.
 void setStyle(java.lang.String newStyle)
          Set the text style
 void setText(java.lang.String text)
          Sets the content of the pop-up window.
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, 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, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, 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, updateUI
 
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, 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

fontSize

protected int fontSize

x

protected double x

y

protected double y

width

protected double width

height

protected double height

scale1

protected double scale1

scale2

protected double scale2

scale3

protected double scale3

scale4

protected double scale4

scale5

protected double scale5

scale6

protected double scale6

scale7

protected double scale7

scale8

protected double scale8

text

protected java.lang.String text

captionStyle

protected java.lang.String captionStyle

stroke

protected java.awt.Stroke stroke

textArea

protected TextArea textArea

first

protected boolean first

currentProject

protected Project currentProject
Constructor Detail

PopUpWindow

public PopUpWindow()
Creates a new instance of PopUpWindow

Parameters:
x - int specifying the x-coordinate of the pop-up window.
y - int specifying the y-coordinate of the pop-up window.
text - String the text to be displayed in the pop-up window.
Method Detail

setBounds

public void setBounds(int x1,
                      int y1,
                      int w1,
                      int h1)
Set the size of the pop-up window.

Overrides:
setBounds in class java.awt.Component
Parameters:
x1 - int specifying the x coordinate of the component.
y1 - int specifying the y coordinate of the component.
w1 - int specifying the width of the component.
h1 - int specifying the height of the component.

setText

public void setText(java.lang.String text)
Sets the content of the pop-up window.

Specified by:
setText in interface TextHolder
Parameters:
text - String specifying the content.

getText

public java.lang.String getText()
Returns the content currently displayed in the pop-up window.

Specified by:
getText in interface TextHolder
Returns:
String containing the currently displayed text.

setFontSize

public void setFontSize(java.lang.String fontSize)
Sets the size of the font displayed in the pop-up window.

Parameters:
fontSize - String specifying the size of the font.

setFontSize

public void setFontSize(int fontSize)
Sets the size of the font displayed in the pop-up window.

Parameters:
fontSize - int specifying the size of the font.

getFontSize

public int getFontSize()
Returns the font size of the currently displayed text.

Returns:
int specifying the font size of the currently displayed text.

setStyle

public void setStyle(java.lang.String newStyle)
Set the text style

Parameters:
newStyle - the new text style

paintComponent

public void paintComponent(java.awt.Graphics g)
Paints the pop-up window within its parent component.

Overrides:
paintComponent in class javax.swing.JComponent
Parameters:
g - the delegate Graphics object.