Package jmri.jmrit.display
Class PositionablePopupUtil
- java.lang.Object
-
- jmri.jmrit.display.PositionablePopupUtil
-
- Direct Known Subclasses:
ReporterIcon.ReporterPopupUtil
,SensorIcon.SensorPopupUtil
public class PositionablePopupUtil extends java.lang.Object
This class handles text attributes for Positionables. Font, size, style and color. Margin size and color, Border size and color, Fixed sizes. Justification.moved from PositionableLabel
-
-
Field Summary
Fields Modifier and Type Field Description protected Positionable
_parent
protected PositionablePropertiesUtil
_propertiesUtil
protected PositionablePopupUtil
_self
protected javax.swing.JComponent
_textComponent
protected int
_textType
static int
BACKGROUND_COLOR
(package private) javax.swing.JMenuItem
bold
static int
BORDER_COLOR
static int
CENTRE
(package private) java.util.ArrayList<javax.swing.JMenuItem>
editAdditionalMenu
static int
FONT_COLOR
*************************************************************************************static int
HORIZONTAL
(package private) javax.swing.JMenuItem
italic
protected int
JCOMPONENT
protected int
LABEL
static int
LEFT
static int
MIN_SIZE
static int
RIGHT
protected int
TEXTFIELD
static int
VERTICAL_DOWN
static int
VERTICAL_UP
(package private) java.util.ArrayList<javax.swing.JMenuItem>
viewAdditionalMenu
-
Constructor Summary
Constructors Constructor Description PositionablePopupUtil(Positionable parent, javax.swing.JComponent textComp)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addEditPopUpMenu(javax.swing.JMenuItem menu)
Add a menu item to be displayed when the popup menu is called for when in edit mode.(package private) void
addFontSizeMenuEntry(javax.swing.JMenu menu, javax.swing.ButtonGroup fontButtonGroup, int size)
(package private) void
addJustificationMenuEntry(javax.swing.JMenu menu, int just)
(package private) void
addOrientationMenuEntry(javax.swing.JMenu menu, int ori)
void
addViewPopUpMenu(javax.swing.JMenuItem menu)
Add a menu item to be displayed when the popup menu is called for when in view mode.PositionablePopupUtil
clone(Positionable parent, javax.swing.JComponent textComp)
void
copyItem(javax.swing.JPopupMenu popup)
java.awt.Color
getBackground()
java.awt.Color
getBorderColor()
int
getBorderSize()
int
getFixedHeight()
int
getFixedWidth()
java.awt.Font
getFont()
int
getFontSize()
int
getFontStyle()
java.awt.Color
getForeground()
int
getJustification()
int
getMargin()
int
getOrientation()
java.lang.String
getText()
boolean
hasBackground()
protected javax.swing.JMenu
makeFontMenu()
protected javax.swing.JMenu
makeFontSizeMenu()
protected javax.swing.JMenu
makeFontStyleMenu()
protected javax.swing.JMenuItem
newStyleMenuItem(javax.swing.AbstractAction a, int mask)
void
propertyUtil(javax.swing.JPopupMenu popup)
void
setAdditionalEditPopUpMenu(javax.swing.JPopupMenu popup)
Add the menu items to the edit popup menuvoid
setAdditionalViewPopUpMenu(javax.swing.JPopupMenu popup)
Add the menu items to the view popup menu.void
setBackgroundColor(java.awt.Color color)
void
setBackgroundMenu(javax.swing.JPopupMenu popup)
(package private) void
setBold()
void
setBorder(boolean set)
void
setBorderColor(java.awt.Color border)
void
setBorderSize(int border)
void
setFixedHeight(int h)
void
setFixedSize(int w, int h)
void
setFixedTextMenu(javax.swing.JPopupMenu popup)
void
setFixedWidth(int w)
void
setFont(java.awt.Font font)
void
setFontSize(float newSize)
void
setFontStyle(int style)
void
setFontStyle(int addStyle, int dropStyle)
void
setForeground(java.awt.Color c)
void
setHasBackground(boolean set)
void
setHorizontalAlignment(int alignment)
(package private) void
setItalic()
void
setJustification(int just)
void
setJustification(java.lang.String just)
void
setMargin(int m)
void
setOrientation(int ori)
void
setOrientation(java.lang.String ori)
void
setSuppressRecentColor(boolean b)
void
setTextBorderMenu(javax.swing.JPopupMenu popup)
void
setTextFontMenu(javax.swing.JPopupMenu popup)
void
setTextJustificationMenu(javax.swing.JPopupMenu popup)
void
setTextMarginMenu(javax.swing.JPopupMenu popup)
void
setTextOrientationMenu(javax.swing.JPopupMenu popup)
java.lang.String
toString()
-
-
-
Field Detail
-
_textComponent
protected javax.swing.JComponent _textComponent
-
_textType
protected int _textType
-
_parent
protected Positionable _parent
-
_self
protected PositionablePopupUtil _self
-
_propertiesUtil
protected PositionablePropertiesUtil _propertiesUtil
-
LABEL
protected final int LABEL
- See Also:
- Constant Field Values
-
TEXTFIELD
protected final int TEXTFIELD
- See Also:
- Constant Field Values
-
JCOMPONENT
protected final int JCOMPONENT
- See Also:
- Constant Field Values
-
FONT_COLOR
public static final int FONT_COLOR
*************************************************************************************- See Also:
- Constant Field Values
-
BACKGROUND_COLOR
public static final int BACKGROUND_COLOR
- See Also:
- Constant Field Values
-
BORDER_COLOR
public static final int BORDER_COLOR
- See Also:
- Constant Field Values
-
MIN_SIZE
public static final int MIN_SIZE
- See Also:
- Constant Field Values
-
italic
javax.swing.JMenuItem italic
-
bold
javax.swing.JMenuItem bold
-
LEFT
public static final int LEFT
- See Also:
- Constant Field Values
-
RIGHT
public static final int RIGHT
- See Also:
- Constant Field Values
-
CENTRE
public static final int CENTRE
- See Also:
- Constant Field Values
-
HORIZONTAL
public static final int HORIZONTAL
- See Also:
- Constant Field Values
-
VERTICAL_UP
public static final int VERTICAL_UP
- See Also:
- Constant Field Values
-
VERTICAL_DOWN
public static final int VERTICAL_DOWN
- See Also:
- Constant Field Values
-
editAdditionalMenu
java.util.ArrayList<javax.swing.JMenuItem> editAdditionalMenu
-
viewAdditionalMenu
java.util.ArrayList<javax.swing.JMenuItem> viewAdditionalMenu
-
-
Constructor Detail
-
PositionablePopupUtil
public PositionablePopupUtil(Positionable parent, javax.swing.JComponent textComp)
-
-
Method Detail
-
clone
public PositionablePopupUtil clone(Positionable parent, javax.swing.JComponent textComp)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
propertyUtil
public void propertyUtil(javax.swing.JPopupMenu popup)
-
setFixedTextMenu
public void setFixedTextMenu(javax.swing.JPopupMenu popup)
-
setTextMarginMenu
public void setTextMarginMenu(javax.swing.JPopupMenu popup)
-
setBackgroundMenu
public void setBackgroundMenu(javax.swing.JPopupMenu popup)
-
setTextBorderMenu
public void setTextBorderMenu(javax.swing.JPopupMenu popup)
-
setTextFontMenu
public void setTextFontMenu(javax.swing.JPopupMenu popup)
-
getMargin
public int getMargin()
-
setMargin
public void setMargin(int m)
-
getFixedWidth
public int getFixedWidth()
-
setFixedWidth
public void setFixedWidth(int w)
-
getFixedHeight
public int getFixedHeight()
-
setFixedHeight
public void setFixedHeight(int h)
-
setFixedSize
public void setFixedSize(int w, int h)
-
setBorderSize
public void setBorderSize(int border)
-
setBorder
public void setBorder(boolean set)
-
getBorderSize
public int getBorderSize()
-
setBorderColor
public void setBorderColor(java.awt.Color border)
-
getBorderColor
public java.awt.Color getBorderColor()
-
setForeground
public void setForeground(java.awt.Color c)
-
getForeground
public java.awt.Color getForeground()
-
setBackgroundColor
public void setBackgroundColor(java.awt.Color color)
-
setSuppressRecentColor
public void setSuppressRecentColor(boolean b)
-
setHasBackground
public void setHasBackground(boolean set)
-
hasBackground
public boolean hasBackground()
-
getBackground
public java.awt.Color getBackground()
-
makeFontMenu
protected javax.swing.JMenu makeFontMenu()
-
makeFontSizeMenu
protected javax.swing.JMenu makeFontSizeMenu()
-
addFontSizeMenuEntry
void addFontSizeMenuEntry(javax.swing.JMenu menu, javax.swing.ButtonGroup fontButtonGroup, int size)
-
setFont
public void setFont(java.awt.Font font)
-
getFont
public java.awt.Font getFont()
-
setFontSize
public void setFontSize(float newSize)
-
getFontSize
public int getFontSize()
-
setItalic
void setItalic()
-
setBold
void setBold()
-
makeFontStyleMenu
protected javax.swing.JMenu makeFontStyleMenu()
-
setFontStyle
public void setFontStyle(int style)
-
setFontStyle
public void setFontStyle(int addStyle, int dropStyle)
-
getFontStyle
public int getFontStyle()
-
newStyleMenuItem
protected javax.swing.JMenuItem newStyleMenuItem(javax.swing.AbstractAction a, int mask)
-
copyItem
public void copyItem(javax.swing.JPopupMenu popup)
-
setTextJustificationMenu
public void setTextJustificationMenu(javax.swing.JPopupMenu popup)
-
setJustification
public void setJustification(int just)
-
setJustification
public void setJustification(java.lang.String just)
-
getJustification
public int getJustification()
-
addJustificationMenuEntry
void addJustificationMenuEntry(javax.swing.JMenu menu, int just)
-
setHorizontalAlignment
public void setHorizontalAlignment(int alignment)
-
getText
public java.lang.String getText()
-
getOrientation
public int getOrientation()
-
setOrientation
public void setOrientation(int ori)
-
setOrientation
public void setOrientation(java.lang.String ori)
-
setTextOrientationMenu
public void setTextOrientationMenu(javax.swing.JPopupMenu popup)
-
addOrientationMenuEntry
void addOrientationMenuEntry(javax.swing.JMenu menu, int ori)
-
addEditPopUpMenu
public void addEditPopUpMenu(javax.swing.JMenuItem menu)
Add a menu item to be displayed when the popup menu is called for when in edit mode.- Parameters:
menu
- the item to add
-
addViewPopUpMenu
public void addViewPopUpMenu(javax.swing.JMenuItem menu)
Add a menu item to be displayed when the popup menu is called for when in view mode.- Parameters:
menu
- menu item or submenu to add
-
setAdditionalEditPopUpMenu
public void setAdditionalEditPopUpMenu(javax.swing.JPopupMenu popup)
Add the menu items to the edit popup menu- Parameters:
popup
- the menu to add items to
-
setAdditionalViewPopUpMenu
public void setAdditionalViewPopUpMenu(javax.swing.JPopupMenu popup)
Add the menu items to the view popup menu.- Parameters:
popup
- the menu to add items to
-
-