Example usage for com.jgoodies.forms.layout CellConstraints CellConstraints

List of usage examples for com.jgoodies.forms.layout CellConstraints CellConstraints

Introduction

In this page you can find the example usage for com.jgoodies.forms.layout CellConstraints CellConstraints.

Prototype

public CellConstraints(int gridX, int gridY) 

Source Link

Document

Constructs an instance of CellConstraints for the given cell position.

Examples:

 new CellConstraints(1, 3); new CellConstraints(1, 3); 

Usage

From source file:com.jeta.swingbuilder.gui.commands.DeleteComponentCommand.java

License:Open Source License

/**
 * ctor/*from   w  w  w  .j  a va2 s . c  o m*/
 */
public DeleteComponentCommand(GridComponent gc, ComponentSource compsrc) {
    super(gc.getParentView().getParentForm());

    m_gc = gc;
    assert (getView() != null);

    m_comp_constraints = m_gc.getConstraints().createCellConstraints();
    m_default_constraints = new CellConstraints(m_gc.getColumn(), m_gc.getRow());

    try {
        EmptyComponentFactory factory = new EmptyComponentFactory(compsrc);
        m_empty = (StandardComponent) factory.createComponent("empty", getView());
    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:com.jeta.swingbuilder.gui.effects.PaintAssignmentView.java

License:Open Source License

/**
 * Loads the GradientView into this view
 *//* w  ww. j  a  v  a 2 s.c  o m*/
void loadView(Class viewClass) {
    JETAController controller = getController();

    try {
        controller.enableEvents(false);
        FormAccessor form_access = m_view.getFormAccessor(PaintNames.ID_SETTINGS_PANEL);
        form_access.removeBean(PaintNames.ID_MAIN_VIEW);

        /*
         * if ( m_current_view != null ) { FormPanel.removeFromParent(
         * (java.awt.Component)m_current_view.getView() ); }
         */

        PaintViewProxy fillview = (PaintViewProxy) m_views.get(viewClass);
        if (fillview == null) {
            if (viewClass == GradientView.class) {
                fillview = new PaintViewProxy(new GradientView(m_preview), null);
                m_view.setSelected(PaintNames.ID_LINEAR_GRADIENT_FILL, true);

            } else if (viewClass == TextureView.class) {
                fillview = new PaintViewProxy(new TextureView(m_preview), new ImagePropertiesValidator());
                m_view.setSelected(PaintNames.ID_TEXTURE_FILL, true);
            } else if (viewClass == SolidView.class) {
                fillview = new PaintViewProxy(new SolidView(m_preview), null);
                m_view.setSelected(PaintNames.ID_SOLID_FILL, true);
            } else if (viewClass == RadialView.class) {
                fillview = new PaintViewProxy(new RadialView(m_preview), null);
                m_view.setSelected(PaintNames.ID_RADIAL_GRADIENT_FILL, true);
            } else if (viewClass == ImageFillView.class) {
                fillview = new PaintViewProxy(new ImageFillView(m_preview), null);
                m_view.setSelected(PaintNames.ID_IMAGE_FILL, true);
            } else {
                fillview = new PaintViewProxy(new NoFillView(m_preview), null);
                m_view.setSelected(PaintNames.ID_NO_FILL, true);
            }
            m_views.put(viewClass, fillview);
        }

        m_current_view = fillview;
        java.awt.Component comp = (java.awt.Component) fillview.getView();
        comp.setName(PaintNames.ID_MAIN_VIEW);
        form_access.addBean(comp, new CellConstraints(2, 2));
        m_view.revalidate();

        revalidate();
        repaint();
    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        controller.enableEvents(true);
    }

}