Search in sources :

Example 6 with WrappedTextComp

use of eidolons.swing.components.panels.page.log.WrappedTextComp in project Eidolons by IDemiurge.

the class OptionDialog method createComponent.

@Override
public Component createComponent() {
    panel = new G_Panel(getVisuals());
    if (vertical) {
        panel.setLayout(new MigLayout("fillx, flowy"));
    } else {
        panel.setLayout(new MigLayout("fillx"));
    }
    // panel.add(new TextComp(null, title), "");
    for (Object o : options) {
        addButton(o);
    }
    WrappedTextComp comp = new WrappedTextComp(null, true) {

        protected int getDefaultFontSize() {
            return 16;
        }

        public void wrapTextLines() {
            super.wrapTextLines();
        }

        protected Dimension initDefaultSize() {
            return getPanelSize();
        }

        public Dimension getPanelSize() {
            return new Dimension(OptionDialog.this.getVisuals().getWidth() - 42, OptionDialog.this.getVisuals().getHeight() - VISUALS.BUTTON.getHeight() - 32);
        }
    };
    comp.setPanelSize(new Dimension(getVisuals().getWidth() - 42, getVisuals().getHeight() - VISUALS.BUTTON.getHeight() - 32));
    comp.setText(title);
    comp.refresh();
    panel.add(comp, "@pos center_x 75");
    return panel;
}
Also used : G_Panel(main.swing.generic.components.G_Panel) MigLayout(net.miginfocom.swing.MigLayout) WrappedTextComp(eidolons.swing.components.panels.page.log.WrappedTextComp)

Aggregations

WrappedTextComp (eidolons.swing.components.panels.page.log.WrappedTextComp)6 ArrayList (java.util.ArrayList)2 G_Panel (main.swing.generic.components.G_Panel)2 GraphicComponent (main.swing.generic.components.misc.GraphicComponent)2 SpecialValueBar (eidolons.client.cc.gui.neo.bars.SpecialValueBar)1 TextCompDC (eidolons.swing.components.panels.page.info.element.TextCompDC)1 HashMap (java.util.HashMap)1 List (java.util.List)1 PARAMETER (main.content.values.parameters.PARAMETER)1 ObjType (main.entity.type.ObjType)1 Decorator (main.swing.generic.Decorator)1 G_ListPanel (main.swing.generic.components.panels.G_ListPanel)1 MigLayout (net.miginfocom.swing.MigLayout)1