Пример #1
0
 void cmdExportPng() throws IOException {
   log.debug("-");
   final JFileChooser fc = new PngFileChooser(currentFile);
   if (JFileChooser.APPROVE_OPTION == fc.showSaveDialog(this)) {
     final File dst = fc.getSelectedFile();
     try {
       this.setCursor(Cwait);
       master.exportPng(dst);
     } finally {
       this.setCursor(Cdefault);
     }
   }
 }
Пример #2
0
  public TacticsApp() {
    addWindowListener(
        new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
            TacticsApp.this.cmdExit();
          }
        });
    master = new RockEditDisplay();
    master.setPos(mod_locations);
    master.setSpeed(mod_speeds);
    final PositionDisplay pnl2 = new PositionDisplay();
    pnl2.setPos(mod_locations);
    pnl2.setZoom(Zoomer.HOG2HACK);

    final Container con = getContentPane();
    {
      final JPanel p = new JPanel(new BorderLayout());
      p.add(new SumWaitDisplay(mod_locations), "West");
      p.add(master, "Center");
      p.add(new SumShotDisplay(mod_locations), "East");
      con.add(p, "Center");
    }
    // con.add(new SumWaitDisplay(mod_locations), "West");
    con.add(new SumOutDisplay(mod_locations), "West");
    {
      final Box b1 = Box.createHorizontalBox();
      b1.add(Box.createRigidArea(new Dimension(0, 75)));
      b1.add(pnl2);
      con.add(b1, "South");
    }
    final JTabbedPane t = new JTabbedPane();
    con.add(t, "East");
    {
      final Box b0 = Box.createHorizontalBox();
      t.add("Rock", b0);
      {
        final JPanel b1 = new JPanel(new BorderLayout());
        final Box b2 = Box.createVerticalBox();
        b2.add(new JComboBox(new String[] {"Dark", "Light"}));
        b2.add(new JLabel("Broom", SwingConstants.LEFT));
        b1.add(b2, "North");
        JSlider s = new JSlider(-2000, 2000, 0);
        s.setOrientation(SwingConstants.VERTICAL);
        s.setMajorTickSpacing(1000);
        s.setMinorTickSpacing(100);
        s.setPaintLabels(true);
        s.setPaintTicks(true);
        b1.add(s, "Center");

        final Box b3 = Box.createHorizontalBox();
        b3.add(new JFormattedTextField());
        b3.add(new JLabel("mm", SwingConstants.LEFT));
        b1.add(b3, "South");
        b0.add(b1);
      }
      {
        final JPanel b1 = new JPanel(new BorderLayout());
        final Box b2 = Box.createVerticalBox();
        b2.add(new JComboBox(new String[] {"1", "2", "3", "4", "5", "6", "7", "8"}));
        b2.add(new JLabel("Splittime", SwingConstants.LEFT));
        b1.add(b2, "North");
        JSlider s = new JSlider(500, 2500, 1500);
        s.setOrientation(SwingConstants.VERTICAL);
        s.setMajorTickSpacing(1000);
        s.setMinorTickSpacing(100);
        s.setPaintLabels(true);
        s.setPaintTicks(true);
        b1.add(s, "Center");

        final Box b3 = Box.createHorizontalBox();
        b3.add(new JSpinner());
        b3.add(new JLabel("ms", SwingConstants.LEFT));
        b1.add(b3, "South");
        b0.add(b1);
      }
    }
    {
      final Box b0 = Box.createHorizontalBox();
      t.add("Ice", b0);
      {
        final JPanel b1 = new JPanel(new BorderLayout());
        b1.add(new JLabel("Curl"), "North");
        JSlider s = new JSlider(0, 5000, 0);
        s.setOrientation(SwingConstants.VERTICAL);
        s.setMajorTickSpacing(1000);
        s.setMinorTickSpacing(100);
        s.setPaintLabels(true);
        s.setPaintTicks(true);
        b1.add(s, "Center");

        final JSpinner s1 = new JSpinner();
        b1.add(s1, "South");
        b0.add(b1);
      }
      {
        final JPanel b1 = new JPanel(new BorderLayout());
        b1.add(new JLabel("DrawToTee"), "North");
        JSlider s = new JSlider(15000, 30000, 25000);
        s.setOrientation(SwingConstants.VERTICAL);
        s.setMajorTickSpacing(5000);
        s.setMinorTickSpacing(1000);
        s.setPaintLabels(true);
        s.setPaintTicks(true);
        b1.add(s, "Center");

        final JSpinner s1 = new JSpinner();
        b1.add(s1, "South");
        b0.add(b1);
      }
    }
    setJMenuBar(createMenu());
    refreshTitle();
    this.setSize(900, 400);

    new SpeedController(mod_locations, mod_speeds, master);
    new LocationController(mod_locations, pnl2);
    lastSaved = mod_locations.getLastChanged();
  }