Search in sources :

Example 1 with DefaultPanelCreator

use of com.ramussoft.pb.master.gui.DefaultPanelCreator in project ramus by Vitaliy-Yakovchuk.

the class MainDialog method showModal.

public void showModal(final DataPlugin dataPlugin, final ProjectOptions projectOptions) {
    final Properties name_author = new DefaultProperties(new Property[] { new DefaultProperty(AUTOR, Property.TEXT_FIELD), new DefaultProperty(PROJECT_NAME, Property.TEXT_FIELD) }, Factory.getString("name_author.Describe"));
    final Properties used_at = new DefaultProperties(new Property[] { new DefaultProperty(USED_AT, Property.TEXT_FIELD) }, Factory.getString("used_at.Describe"));
    final Properties def = new DefaultProperties(new Property[] { new DefaultProperty(DEFINITION, Property.TEXT) }, Factory.getString("describe.Describe"));
    masterModel = new DefaultMasterModel(new Properties[] { name_author, used_at, def });
    mainPanel = new MainPanel(new DefaultPanelCreator(masterModel)) {

        @Override
        public boolean cancel() {
            if (super.cancel()) {
                MainDialog.this.setVisible(false);
                return true;
            }
            return false;
        }

        @Override
        protected void finish() {
            super.finish();
            projectOptions.setProjectAutor(getValue(AUTOR));
            projectOptions.setProjectName(getValue(PROJECT_NAME));
            projectOptions.setDefinition(getValue(DEFINITION));
            projectOptions.setUsedAt(getValue(USED_AT));
            MainDialog.this.setVisible(false);
        }
    };
    setContentPane(mainPanel);
    pack();
    setMinimumSize(this.getSize());
    setLocationRelativeTo(null);
    setVisible(true);
    frame.repaint();
}
Also used : DefaultProperties(com.ramussoft.pb.master.model.DefaultProperties) DefaultPanelCreator(com.ramussoft.pb.master.gui.DefaultPanelCreator) MainPanel(com.ramussoft.pb.master.gui.MainPanel) DefaultProperties(com.ramussoft.pb.master.model.DefaultProperties) Properties(com.ramussoft.pb.master.model.Properties) DefaultMasterModel(com.ramussoft.pb.master.model.DefaultMasterModel) DefaultProperty(com.ramussoft.pb.master.model.DefaultProperty)

Aggregations

DefaultPanelCreator (com.ramussoft.pb.master.gui.DefaultPanelCreator)1 MainPanel (com.ramussoft.pb.master.gui.MainPanel)1 DefaultMasterModel (com.ramussoft.pb.master.model.DefaultMasterModel)1 DefaultProperties (com.ramussoft.pb.master.model.DefaultProperties)1 DefaultProperty (com.ramussoft.pb.master.model.DefaultProperty)1 Properties (com.ramussoft.pb.master.model.Properties)1