Search in sources :

Example 6 with PositionablePopupUtil

use of jmri.jmrit.display.PositionablePopupUtil in project JMRI by JMRI.

the class DecoratorPanel method doPopupUtility.

private void doPopupUtility(String type, int which, PositionableLabel sample, PositionablePopupUtil ut, boolean editText) {
    PositionablePopupUtil util = sample.getPopupUtility();
    util.setJustification(ut.getJustification());
    util.setHorizontalAlignment(ut.getJustification());
    util.setFixedWidth(ut.getFixedWidth());
    util.setFixedHeight(ut.getFixedHeight());
    util.setMargin(ut.getMargin());
    util.setBorderSize(ut.getBorderSize());
    util.setBorderColor(ut.getBorderColor());
    util.setFont(util.getFont().deriveFont(ut.getFontStyle()));
    util.setFontSize(ut.getFontSize());
    util.setOrientation(ut.getOrientation());
    sample.updateSize();
    _sample.put(type, sample);
    this.add(makeTextPanel(type, sample, which, editText));
    _samplePanel.add(sample);
    _samplePanel.add(Box.createHorizontalStrut(STRUT));
}
Also used : PositionablePopupUtil(jmri.jmrit.display.PositionablePopupUtil)

Aggregations

PositionablePopupUtil (jmri.jmrit.display.PositionablePopupUtil)6 JPopupMenu (javax.swing.JPopupMenu)2 PositionableLabel (jmri.jmrit.display.PositionableLabel)2 Color (java.awt.Color)1 Font (java.awt.Font)1 Border (javax.swing.border.Border)1 CompoundBorder (javax.swing.border.CompoundBorder)1 LineBorder (javax.swing.border.LineBorder)1 LinkingObject (jmri.jmrit.display.LinkingObject)1 LocoIcon (jmri.jmrit.display.LocoIcon)1 MemoryIcon (jmri.jmrit.display.MemoryIcon)1 PositionableJPanel (jmri.jmrit.display.PositionableJPanel)1 SensorIcon (jmri.jmrit.display.SensorIcon)1 Attribute (org.jdom2.Attribute)1 DataConversionException (org.jdom2.DataConversionException)1