|
||||||||||
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
com.jaxfront.swing.ui.tools.HeaderPanel
public class HeaderPanel
An instance of this class is a panel that can display several types of header. Note that jaxfront use three type of header which are a modern separator, a classic seperator and a header. Use the main methode to demostrate the header's.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Field Summary | |
---|---|
static int |
SEPARATOR_CLASSIC
|
static int |
SEPARATOR_MODERN
|
static int |
SEPARATOR_NONE
|
static int |
SEPARATOR_VERTICAL
|
Fields inherited from class javax.swing.JComponent |
---|
TOOL_TIP_TEXT_KEY, 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 | |
---|---|
HeaderPanel(java.lang.String text)
Creates a new instance of this class which draws a header with the specified text, seperator type. |
|
HeaderPanel(java.lang.String name,
int separator)
Creates a new instance of this class which draws a header with the specified text and seperator type. |
|
HeaderPanel(java.lang.String name,
int height,
java.awt.Color textColor,
java.awt.Color startColor,
java.awt.Color endColor)
Creates a new instance of this class which draws a header with the specified text, height and colors. |
|
HeaderPanel(java.lang.String text,
int height,
java.awt.Color textColor,
java.awt.Color startColor,
java.awt.Color endColor,
int separator)
Creates a new instance of this class which draws a header with the specified text, height, colors and separator type. |
|
HeaderPanel(java.lang.String text,
int height,
int topSpacing,
int bottomSpacing,
java.awt.Color textColor,
java.awt.Color startColor,
java.awt.Color endColor,
int separator)
Creates a new instance of this class which draws a header with the specified text, height, colors and separator type. |
|
HeaderPanel(java.lang.String text,
int height,
int topSpacing,
int bottomSpacing,
java.awt.Color textColor,
javax.swing.ImageIcon imageIcon)
Creates a new instance of this class which draws a header with the specified text, height, the spaces at top and bottom, the colors, which separator type and the font for the text. |
|
HeaderPanel(Type type,
java.lang.String text,
int height,
int topSpacing,
int bottomSpacing,
java.awt.Color textColor,
java.awt.Color startColor,
java.awt.Color endColor,
int separator)
Creates a new instance of this class which draws a header with the specified text, height, colors and separator type. |
|
HeaderPanel(Type type,
java.lang.String text,
int height,
int topSpacing,
int bottomSpacing,
java.awt.Color textColor,
java.awt.Color startColor,
java.awt.Color endColor,
int separator,
java.awt.Font textFont)
Creates a new instance of this class which draws a header with the specified text, height, the spaces at top and bottom, the colors, which separator type and the font for the text. |
|
HeaderPanel(Type type,
java.lang.String text,
int height,
int topSpacing,
int bottomSpacing,
java.awt.Color textColor,
java.awt.Color startColor,
java.awt.Color endColor,
int separator,
java.awt.Font textFont,
javax.swing.ImageIcon imageIcon)
Creates a new instance of this class which draws a header with the specified text, height, the spaces at top and bottom, the colors, which separator type and the font for the text. |
|
HeaderPanel(Type type,
java.lang.String text,
int height,
int topSpacing,
int bottomSpacing,
java.awt.Color textColor,
java.awt.Color startColor,
java.awt.Color endColor,
int separator,
java.awt.Font textFont,
javax.swing.ImageIcon imageIcon,
boolean enableCopyPastePopup)
Creates a new instance of this class which draws a header with the specified text, height, the spaces at top and bottom, the colors, which separator type and the font for the text. |
|
HeaderPanel(Type type,
java.lang.String text,
int height,
int topSpacing,
int bottomSpacing,
java.awt.Color textColor,
javax.swing.ImageIcon imageIcon)
Creates a new instance of this class which draws a header with the specified text, height, the spaces at top and bottom, the colors, which separator type and the font for the text. |
Method Summary | |
---|---|
void |
drawText(java.awt.Graphics g,
java.lang.String text,
int x,
int y)
|
java.awt.Font |
getFont()
|
FunctionalGraphics |
getFunctionalGrapics()
This is a lazy method! |
java.lang.String |
getHeaderTitle()
|
int |
getInsetHeight()
|
java.awt.Dimension |
getPreferredSize()
If the preferredSize has been set to a non-null value just return it. |
int |
getSeparatorType()
|
java.awt.Color |
getTextColor()
|
void |
initListener()
|
boolean |
isPopupMenuEnabled()
|
static void |
main(java.lang.String[] args)
Main method to start a demo of this class. |
void |
mouseClicked(java.awt.event.MouseEvent e)
Invoked when the mouse has been clicked on a component. |
void |
mouseDragged(java.awt.event.MouseEvent e)
Invoked when a mouse button is pressed on a component and then dragged. |
void |
mouseEntered(java.awt.event.MouseEvent e)
Invoked when the mouse enters a component. |
void |
mouseExited(java.awt.event.MouseEvent e)
Invoked when the mouse exits a component. |
void |
mouseMoved(java.awt.event.MouseEvent e)
Invoked when the mouse button has been moved on a component (with no buttons no down). |
void |
mousePressed(java.awt.event.MouseEvent e)
Invoked when a mouse button has been pressed on a component. |
void |
mouseReleased(java.awt.event.MouseEvent e)
Invoked when a mouse button has been released on a component. |
void |
paint(java.awt.Graphics g)
This method is invoked by Swing to draw components. |
void |
paintClassic(java.awt.Graphics g)
|
void |
paintHorizontal(java.awt.Graphics g)
|
void |
paintImage(java.awt.Graphics g)
|
void |
paintModern(java.awt.Graphics g)
|
void |
paintVertical(java.awt.Graphics g)
|
void |
releaseListener()
|
void |
setFont(java.awt.Font textFont)
|
void |
setHeaderTitle(java.lang.String text)
Sets the title for the header. |
void |
setInsetHeight(int height)
|
void |
setLink(java.lang.String linkURL)
Sets an HTML link to the header. |
void |
setPopupMenuEnabled(boolean enabled)
|
void |
setStartColor(java.awt.Color startColor)
|
void |
setTextColor(java.awt.Color textColor)
|
void |
setTextIndent(int indent)
|
void |
setToolTipText(java.lang.String toolTipText)
Sets a tool tip to the header. |
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, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, 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, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, 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, transferFocusBackward, 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, 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, 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 |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int SEPARATOR_NONE
public static final int SEPARATOR_CLASSIC
public static final int SEPARATOR_MODERN
public static final int SEPARATOR_VERTICAL
Constructor Detail |
---|
public HeaderPanel(java.lang.String text)
text
- the text that should be displayedpublic HeaderPanel(java.lang.String name, int separator)
text
- the text that should be displayedseparator
- the seperator typepublic HeaderPanel(java.lang.String text, int height, int topSpacing, int bottomSpacing, java.awt.Color textColor, java.awt.Color startColor, java.awt.Color endColor, int separator)
text
- the text that should be displayedheight
- the height of the headertopSpacing
- the space at topbottomSpacing
- the space at bottomtextColor
- the color for the textstartColor
- the start color of the headerendColor
- the end color of the headerseparator
- the sepearot typepublic HeaderPanel(Type type, java.lang.String text, int height, int topSpacing, int bottomSpacing, java.awt.Color textColor, java.awt.Color startColor, java.awt.Color endColor, int separator)
type
- JAXFront type to hold on (for copy/paste content actions)text
- the text that should be displayedheight
- the height of the headertopSpacing
- the space at topbottomSpacing
- the space at bottomtextColor
- the color for the textstartColor
- the start color of the headerendColor
- the end color of the headerseparator
- the sepearot typepublic HeaderPanel(Type type, java.lang.String text, int height, int topSpacing, int bottomSpacing, java.awt.Color textColor, java.awt.Color startColor, java.awt.Color endColor, int separator, java.awt.Font textFont)
type
- JAXFront type to hold on (for copy/paste content actions)text
- the text that should be displayedheight
- the height of the headertopSpacing
- the space at topbottomSpacing
- the space at bottomtextColor
- the colot for the textstartColor
- the start color of the headerendColor
- the end color of the headerseparator
- the sepearot typetextFont
- the font for the textpublic HeaderPanel(Type type, java.lang.String text, int height, int topSpacing, int bottomSpacing, java.awt.Color textColor, java.awt.Color startColor, java.awt.Color endColor, int separator, java.awt.Font textFont, javax.swing.ImageIcon imageIcon)
type
- JAXFront type to hold on (for copy/paste content actions)text
- the text that should be displayedheight
- the height of the headertopSpacing
- the space at topbottomSpacing
- the space at bottomtextColor
- the colot for the textstartColor
- the start color of the headerendColor
- the end color of the headerseparator
- the sepearot typetextFont
- the font for the textpublic HeaderPanel(Type type, java.lang.String text, int height, int topSpacing, int bottomSpacing, java.awt.Color textColor, java.awt.Color startColor, java.awt.Color endColor, int separator, java.awt.Font textFont, javax.swing.ImageIcon imageIcon, boolean enableCopyPastePopup)
type
- JAXFront type to hold on (for copy/paste content actions)text
- the text that should be displayedheight
- the height of the headertopSpacing
- the space at topbottomSpacing
- the space at bottomtextColor
- the colot for the textstartColor
- the start color of the headerendColor
- the end color of the headerseparator
- the sepearot typetextFont
- the font for the textpublic HeaderPanel(java.lang.String text, int height, int topSpacing, int bottomSpacing, java.awt.Color textColor, javax.swing.ImageIcon imageIcon)
text
- the text that should be displayedheight
- the height of the headertopSpacing
- the space at topbottomSpacing
- the space at bottomtextColor
- the colot for the textstartColor
- the start color of the headerendColor
- the end color of the headerseparator
- the sepearot typetextFont
- the font for the textpublic HeaderPanel(Type type, java.lang.String text, int height, int topSpacing, int bottomSpacing, java.awt.Color textColor, javax.swing.ImageIcon imageIcon)
text
- the text that should be displayedheight
- the height of the headertopSpacing
- the space at topbottomSpacing
- the space at bottomtextColor
- the colot for the textstartColor
- the start color of the headerendColor
- the end color of the headerseparator
- the sepearot typetextFont
- the font for the textpublic HeaderPanel(java.lang.String name, int height, java.awt.Color textColor, java.awt.Color startColor, java.awt.Color endColor)
text
- the text that should be displayedheight
- the height of the headertextColor
- the colot for the textstartColor
- the start color of the headerendColor
- the end color of the headerpublic HeaderPanel(java.lang.String text, int height, java.awt.Color textColor, java.awt.Color startColor, java.awt.Color endColor, int separator)
text
- the text that should be displayedheight
- the height of the headertextColor
- the colot for the textstartColor
- the start color of the headerendColor
- the end color of the headerseparator
- the sepearot typeMethod Detail |
---|
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class javax.swing.JComponent
JComponent.setPreferredSize(java.awt.Dimension)
public static void main(java.lang.String[] args)
args[]
- none arguments are required to start this demopublic void paint(java.awt.Graphics g)
repaint
method to schedule the component for redrawing.
This method actually delegates the work of painting to three protected
methods: paintComponent
,paintBorder
, and
paintChildren
. They're called in the order listed to
ensure that children appear on top of component itself. Generally
speaking, the component and its children should not paint in the insets
area allocated to the border. Subclasses can just override this method,
as always. A subclass that just wants to specialize the UI (look and
feel) delegates paint method should just override
paintComponent
.
paint
in class javax.swing.JComponent
JComponent.paintComponent(java.awt.Graphics)
,
JComponent.paintBorder(java.awt.Graphics)
,
JComponent.paintChildren(java.awt.Graphics)
,
JComponent.getComponentGraphics(java.awt.Graphics)
,
JComponent.repaint(long, int, int, int, int)
public void paintHorizontal(java.awt.Graphics g)
public void drawText(java.awt.Graphics g, java.lang.String text, int x, int y)
public void setTextIndent(int indent)
public void paintImage(java.awt.Graphics g)
public void paintVertical(java.awt.Graphics g)
public void paintClassic(java.awt.Graphics g)
public void paintModern(java.awt.Graphics g)
public void setHeaderTitle(java.lang.String text)
text
- a titlepublic java.lang.String getHeaderTitle()
public void setLink(java.lang.String linkURL)
linkURL
- an HTML linkpublic void setToolTipText(java.lang.String toolTipText)
setToolTipText
in class javax.swing.JComponent
toolTipText
- a text for the toolTipJComponent.setToolTipText(java.lang.String)
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
e
- a mouse event that occuredpublic void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
e
- a mouse event that occuredpublic void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
e
- a mouse event that occuredpublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
e
- a mouse event that occuredpublic void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
e
- a mouse event that occuredpublic void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
e
- a mouse event that occuredpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
e
- a mouse event that occuredpublic void setPopupMenuEnabled(boolean enabled)
public boolean isPopupMenuEnabled()
public void setFont(java.awt.Font textFont)
setFont
in class javax.swing.JComponent
_textFont
- The _textFont to set.public int getSeparatorType()
public void releaseListener()
public void initListener()
public java.awt.Font getFont()
getFont
in interface java.awt.MenuContainer
getFont
in class java.awt.Component
public void setInsetHeight(int height)
_insetHeight
- The _insetHeight to set.public int getInsetHeight()
_insetHeight
- The _insetHeight of the component.public void setTextColor(java.awt.Color textColor)
_textColor
- The _textColor to set.public void setStartColor(java.awt.Color startColor)
public java.awt.Color getTextColor()
public FunctionalGraphics getFunctionalGrapics()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |