jhplot.gui
Class GHMargin
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- jhplot.gui.GHMargin
-
- All Implemented Interfaces:
- java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible
public class GHMargin extends javax.swing.JPanelPanels with global margin. You can access all margins from GHPanel using panel() method.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Field Summary
-
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
-
Constructor Summary
Constructors Constructor and Description GHMargin(GHPanel w, java.lang.String wname)Main class to create global margin
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voiddisposeMe()Dispose this canvasjava.awt.ColorgetGBackground()Get the color of backgroundjava.awt.ColorgetGColor()Get the color of this paneljava.awt.FontgetGFont()Get the font of the textjavax.swing.JPanelgetJPanel()Return JPanel of this marginjava.awt.ColorgetMColor()Get the text colorjava.awt.FontgetMFont()Get the font on this panelintgetRotation()Get the rotation angle of the text in degrees.intgetSizeX()Get the size of this margin panel in XintgetSizeY()Get the size of this margin in Yjava.lang.StringgetString()Get the title of this paneldoublegetStringPositionX()Get the text position in X relative to widthsdoublegetStringPositionY()Get the text position in Y relative to the frame height.booleanisBorder()Is boarder shown?voidsetDefault()Set the default locationvoidsetDefault(java.lang.Object com)Set the default locationvoidsetGBackground(java.awt.Color c)Set the background of this panelvoidsetGColor(java.awt.Color c)Set the color on this panel.voidsetGFont(java.awt.Font f)Set the font.voidsetGRecBackground(java.awt.Color c)Set the background for rectangle with the textvoidsetRotation(int rotation)Set the rotation angle of the text in degrees.voidsetSizeMargin(int x, int y)Set size of this margin panelvoidsetString(java.lang.String sname)Set the text on this panelvoidsetString(java.lang.String sname, java.awt.Font f, java.awt.Color c)voidsetString(java.lang.String sname, java.awt.Font f, java.awt.Color c, java.awt.Dimension dd)Sets the string.voidsetStringPositionX(double x)Set the text position in X relative to the frame widthvoidsetStringPositionY(double y)Set the text position in Y relative to the frame height.voidshowBorder(boolean show)Show or not the blue borders during editing.voidshowBorderNoUpdate(boolean show)Show or not the blue borders during editing.-
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, 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, paint, 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, setVisible, unregisterKeyboardAction, update
-
Methods inherited from class java.awt.Container
add, 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, validate
-
Methods inherited from class java.awt.Component
action, 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, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Constructor Detail
-
GHMargin
public GHMargin(GHPanel w, java.lang.String wname)
Main class to create global margin- Parameters:
w- GHpanelwname- Name of this margin
-
-
Method Detail
-
setDefault
public void setDefault()
Set the default location
-
setDefault
public void setDefault(java.lang.Object com)
Set the default location
-
disposeMe
public void disposeMe()
Dispose this canvas
-
setRotation
public void setRotation(int rotation)
Set the rotation angle of the text in degrees. Only 0, -90 and 90 are supported- Parameters:
rotation- Rotation of the text (0, -90, 90)
-
getRotation
public int getRotation()
Get the rotation angle of the text in degrees. Only 0, -90 and 90 are supported.- Returns:
- Rotation of the text (0, -90, 90)
-
setString
public void setString(java.lang.String sname, java.awt.Font f, java.awt.Color c, java.awt.Dimension dd)Sets the string.- Parameters:
sname- Text of the stringf- Font usedc- Color used
-
setGFont
public void setGFont(java.awt.Font f)
Set the font.- Parameters:
f- Font
-
setGColor
public void setGColor(java.awt.Color c)
Set the color on this panel.- Parameters:
c- Color of the panel
-
getGColor
public java.awt.Color getGColor()
Get the color of this panel- Returns:
- Color
-
getGFont
public java.awt.Font getGFont()
Get the font of the text- Returns:
- Font Font of the text
-
getGBackground
public java.awt.Color getGBackground()
Get the color of background- Returns:
- Color background color
-
getString
public java.lang.String getString()
Get the title of this panel- Returns:
- title of this panel
-
showBorder
public void showBorder(boolean show)
Show or not the blue borders during editing.- Parameters:
show- true if shown
-
isBorder
public boolean isBorder()
Is boarder shown?- Returns:
- true if shown
-
showBorderNoUpdate
public void showBorderNoUpdate(boolean show)
Show or not the blue borders during editing. UI is not updated.- Parameters:
show- true if shown
-
setString
public void setString(java.lang.String sname)
Set the text on this panel- Parameters:
sname- Text
-
setString
public void setString(java.lang.String sname, java.awt.Font f, java.awt.Color c)
-
getMFont
public java.awt.Font getMFont()
Get the font on this panel- Returns:
- Font
-
getMColor
public java.awt.Color getMColor()
Get the text color- Returns:
- color margin color
-
setGBackground
public void setGBackground(java.awt.Color c)
Set the background of this panel- Parameters:
c- Color of this panel
-
setGRecBackground
public void setGRecBackground(java.awt.Color c)
Set the background for rectangle with the text- Parameters:
c- Color of the rectangle
-
getJPanel
public javax.swing.JPanel getJPanel()
Return JPanel of this margin- Returns:
- JPanel this panel
-
setSizeMargin
public void setSizeMargin(int x, int y)Set size of this margin panel- Parameters:
x- size in Xy- size in Y
-
getSizeX
public int getSizeX()
Get the size of this margin panel in X- Returns:
- Size of the panel in X
-
getSizeY
public int getSizeY()
Get the size of this margin in Y- Returns:
- size in Y
-
getStringPositionX
public double getStringPositionX()
Get the text position in X relative to widths- Returns:
- position of text in X (from 0 to 1)
-
getStringPositionY
public double getStringPositionY()
Get the text position in Y relative to the frame height.- Returns:
- position of text in Y (from 0 to 1)
-
setStringPositionX
public void setStringPositionX(double x)
Set the text position in X relative to the frame width- Parameters:
x- position of text in X (from 0 to 1)
-
setStringPositionY
public void setStringPositionY(double y)
Set the text position in Y relative to the frame height.- Parameters:
y- position of text in Y (from 0 to 1)
-
-
DMelt 3.0 © DataMelt by jWork.ORG