Search in sources :

Example 1 with VisualComponent

use of main.swing.generic.components.VisualComponent 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)1 VisualComponent (main.swing.generic.components.VisualComponent)1