Пример #1
0
  /**
   * Creates new PropertiesDialog.
   *
   * @param app parent frame
   */
  public PropertiesDialog(Application app) {
    super(app.getFrame(), false);
    this.app = app;
    kernel = app.getKernel();

    setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
    setResizable(true);

    addWindowListener(this);
    geoTree = new JTreeGeoElements();
    geoTree.addMouseListener(
        new MouseAdapter() {
          @Override
          public void mouseEntered(MouseEvent e) {
            // some textfields are updated when they lose focus
            // give them a chance to do that before we change the selection
            requestFocusInWindow();
          }
        });
    geoTree.addTreeSelectionListener(this);
    geoTree.addKeyListener(this);

    // build GUI
    initGUI();
  }
Пример #2
0
  /**
   * Initialize the GUI and logics.
   *
   * @param app
   */
  public OptionsDialog(Application app) {
    super(app.getFrame(), false);

    this.app = app;

    setResizable(true);
    setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);

    addWindowListener(this);

    initGUI();
    updateGUI();
  }
Пример #3
0
  /**
   * Creates a dialog to create a new GeoNumeric for a slider.
   *
   * @param x, y: location of slider in screen coords
   */
  public ButtonDialog(Application app, int x, int y, boolean textField) {
    super(app.getFrame(), false);
    this.app = app;
    this.textField = textField;
    addWindowListener(this);
    this.x = x;
    this.y = y;
    // create temp geos that may be returned as result
    // Construction cons = app.getKernel().getConstruction();
    // button = textField ? new GeoTextField(cons) : new GeoButton(cons);
    // button.setEuclidianVisible(true);
    // button.setAbsoluteScreenLoc(x, y);

    createGUI();
    pack();
    setLocationRelativeTo(app.getMainComponent());
  }