Search in sources :

Example 1 with VISUALS

use of main.swing.generic.components.G_Panel.VISUALS in project Eidolons by IDemiurge.

the class SessionWindow method init.

public void init() {
    panel = new G_Panel("flowy");
    sessionControlPanel = new SessionControlPanel(session);
    String pos = "pos 0 0, id sessionControlPanel";
    panel.add(sessionControlPanel, pos);
    timer = new SessionTimer(session, session.getIntParam(AT_PARAMS.SESSION_TIME));
    // pos = "pos @center_x directionHeader.y2, id timer";
    pos = "pos 0 sessionControlPanel.y2, id timer";
    panel.add(timer, pos);
    // timer.x2
    boxPanel = new G_Panel();
    pos = "pos @center_x-125 directionHeader.y2-30, id boxPanel";
    panel.add(boxPanel, pos);
    directionBox = initBox(getDirections(), "Direction");
    styleBox = initBox(WORK_STYLE.values(), "Style");
    stateBox = initBox(STATE.values(), "State");
    viewBox = initBox(VIEW_OPTION.values(), "Custom View");
    directionHeader = new DirectionHeader(session);
    pos = "pos 0 sessionControlPanel.y2, id directionHeader";
    panel.add(directionHeader, pos);
    goalsPanel = new GoalPages(session);
    pos = "pos 0 timer.y2, id goalsPanel";
    panel.add(goalsPanel, pos);
    infoPanel = new InfoEditPanel();
    pos = "pos goalsPanel.x2 directionHeader.y2+50, id infoPanel";
    panel.add(infoPanel.getPanel(), pos);
    lockButton = new CustomButton(VISUALS.LOCK) {

        @Override
        public VISUALS getVisuals() {
            return session.isLocked() ? VISUALS.LOCK : VISUALS.UNLOCK;
        }

        @Override
        public void handleClick() {
            session.setLocked(!session.isLocked());
            refresh();
        }
    };
    pos = "pos timer.x+85 timer.y2-50, id lockButton";
    panel.add(lockButton, pos);
    panel.refreshComponents();
}
Also used : VISUALS(main.swing.generic.components.G_Panel.VISUALS) G_Panel(main.swing.generic.components.G_Panel) CustomButton(eidolons.swing.components.buttons.CustomButton)

Example 2 with VISUALS

use of main.swing.generic.components.G_Panel.VISUALS in project Eidolons by IDemiurge.

the class MigMaster method processConstraints.

public static String processConstraints(G_Panel panel, Component comp, String constraints) {
    int height = (int) comp.getPreferredSize().getHeight();
    int width = (int) comp.getPreferredSize().getWidth();
    int container_height = (int) panel.getPreferredSize().getHeight();
    int container_width = (int) panel.getPreferredSize().getWidth();
    if (panel.getVisuals() != null) {
        if (container_height == 0) {
            container_height = panel.getVisuals().getHeight();
        }
        if (container_width == 0) {
            container_width = panel.getVisuals().getWidth();
        }
    }
    if (comp instanceof VisualComponent) {
        VISUALS visuals = ((VisualComponent) comp).getVisuals();
        if (visuals != null) {
            if (height == 0) {
                height = visuals.getHeight();
            }
            if (width == 0) {
                width = visuals.getWidth();
            }
        }
    }
    return process(constraints, height, width, container_height, container_width);
}
Also used : VISUALS(main.swing.generic.components.G_Panel.VISUALS) VisualComponent(main.swing.generic.components.VisualComponent)

Aggregations

VISUALS (main.swing.generic.components.G_Panel.VISUALS)2 CustomButton (eidolons.swing.components.buttons.CustomButton)1 G_Panel (main.swing.generic.components.G_Panel)1 VisualComponent (main.swing.generic.components.VisualComponent)1