Esempio n. 1
0
  /** Construct a new dialog. */
  public JArchiveDialog() {
    super("Archive Tool");

    pPrivilegeDetails = new PrivilegeDetails();

    /* create dialog body components */
    {
      JPanel cpanel = new JPanel();
      {
        cpanel.setName("ButtonDialogPanel");
        cpanel.setLayout(new BoxLayout(cpanel, BoxLayout.Y_AXIS));

        cpanel.add(UIFactory.createPanelLabel("Candidate Versions:"));

        cpanel.add(Box.createRigidArea(new Dimension(0, 4)));

        {
          ArchiveCandidateTableModel model = new ArchiveCandidateTableModel();
          pCandidateTableModel = model;

          JTablePanel tpanel = new JTablePanel(model);
          pCandidateTablePanel = tpanel;

          cpanel.add(tpanel);
        }

        cpanel.add(Box.createRigidArea(new Dimension(0, 5)));

        {
          Box hbox = new Box(BoxLayout.X_AXIS);

          hbox.add(Box.createHorizontalGlue());
          hbox.add(Box.createRigidArea(new Dimension(10, 0)));

          {
            JButton btn =
                UIFactory.createDialogButton(
                    "Search...",
                    "candidate-search",
                    this,
                    "Search for new candidate checked-in versions to archive.");

            hbox.add(btn);
          }

          hbox.add(Box.createRigidArea(new Dimension(20, 0)));

          {
            JButton btn =
                UIFactory.createDialogButton(
                    "Clear",
                    "clear-candidate",
                    this,
                    "Clear the displayed candidate checked-in versions.");

            hbox.add(btn);
          }

          hbox.add(Box.createRigidArea(new Dimension(10, 0)));
          hbox.add(Box.createHorizontalGlue());

          cpanel.add(hbox);
        }
      }

      JPanel apanel = new JPanel();
      {
        apanel.setName("ButtonDialogPanel");
        apanel.setLayout(new BoxLayout(apanel, BoxLayout.Y_AXIS));

        {
          Box box = new Box(BoxLayout.X_AXIS);

          box.add(Box.createRigidArea(new Dimension(4, 0)));

          {
            JLabel label = new JLabel("Versions to Archive:");
            label.setName("PanelLabel");
            box.add(label);
          }

          box.add(Box.createHorizontalGlue());

          {
            JLabel label = new JLabel("Total Size: ???");
            pArchiveSizeLabel = label;
            label.setName("PanelLabel");
            box.add(label);
          }

          box.add(Box.createRigidArea(new Dimension(23, 0)));

          apanel.add(box);
        }

        apanel.add(Box.createRigidArea(new Dimension(0, 4)));

        {
          NodeVersionSizeTableModel model = new NodeVersionSizeTableModel(880);
          pArchiveTableModel = model;

          JTablePanel tpanel = new JTablePanel(model);
          pArchiveTablePanel = tpanel;

          apanel.add(tpanel);
        }

        apanel.add(Box.createRigidArea(new Dimension(0, 5)));

        {
          Box hbox = new Box(BoxLayout.X_AXIS);

          hbox.add(Box.createHorizontalGlue());
          hbox.add(Box.createRigidArea(new Dimension(10, 0)));

          {
            JButton btn =
                UIFactory.createDialogButton(
                    "Add",
                    "add-archive",
                    this,
                    "Add the selected candidate versions to the list of versions to be "
                        + "archived.");

            hbox.add(btn);
          }

          hbox.add(Box.createRigidArea(new Dimension(10, 0)));

          {
            JButton btn =
                UIFactory.createDialogButton(
                    "Add All",
                    "add-all-archive",
                    this,
                    "Add all candidate versions to the list of versions to be archived.");

            hbox.add(btn);
          }

          hbox.add(Box.createRigidArea(new Dimension(20, 0)));

          {
            JButton btn =
                UIFactory.createDialogButton(
                    "Remove",
                    "remove-archive",
                    this,
                    "Remove the selected versions from the list of versions to be archived.");

            hbox.add(btn);
          }

          hbox.add(Box.createRigidArea(new Dimension(10, 0)));

          {
            JButton btn =
                UIFactory.createDialogButton(
                    "Clear",
                    "remove-all-archive",
                    this,
                    "Clear the list of versions to be archived.");

            hbox.add(btn);
          }

          hbox.add(Box.createRigidArea(new Dimension(20, 0)));

          {
            JButton btn =
                UIFactory.createDialogButton(
                    "Calc Sizes",
                    "calc-archive",
                    this,
                    "Calculate the amount of disk space needed to archive the files "
                        + "associated with the checked-in versions.");

            hbox.add(btn);
          }

          hbox.add(Box.createRigidArea(new Dimension(10, 0)));
          hbox.add(Box.createHorizontalGlue());

          apanel.add(hbox);
        }
      }

      JSplitPane body = new JVertSplitPanel(cpanel, apanel);
      body.setAlignmentX(0.5f);

      String extra[][] = {{"Archive...", "archive"}};

      JButton btns[] = super.initUI("Archive Tool:", body, null, null, extra, "Close", null);

      pArchiveButton = btns[0];
      pArchiveButton.setEnabled(false);

      updatePanel();
      pack();
    }

    pQueryDialog = new JArchiveQueryDialog(this);
    pArchiveParamsDialog = new JArchiveParamsDialog(this);
  }
  public IndexingFrame(Frames parent, BatchState bs) {

    this.parent = parent;
    this.batchState = bs;
    this.indexingFrame = this;

    // Set the window's title
    this.setTitle("Indexing");

    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    // Create menu bar
    this.createMenuBar(this);

    this.setPreferredSize(new Dimension(2000, 1000));

    // Set the location of the window on the desktop
    this.setLocation(100, 100);

    // Size the window according to the preferred sizes and layout of its subcomponents
    this.pack();

    Container contentPane = this.getContentPane();
    contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.PAGE_AXIS));

    ButtonBar buttonBar = new ButtonBar(this, batchState);
    contentPane.add(buttonBar);

    JTabbedPane leftTabbedPane = new JTabbedPane();
    formEntry = new FormEntry(this, batchState);
    // TableEntry table = new TableEntry();
    model =
        new DefaultTableModel() {
          @Override
          public boolean isCellEditable(int row, int column) {

            return column != 0;
          }
        };

    //		tableEntry = new JTable(model);
    //		tableEntry.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    //		tableEntry.setColumnSelectionAllowed(true);
    //		tableEntry.setRowSelectionAllowed(true);
    //
    //		tableEntry.setGridColor(Color.BLACK);

    tableEntry = new TableEntry(this, batchState, model);

    JScrollPane scrollpane = new JScrollPane(tableEntry);
    leftTabbedPane.add("Table Entry", scrollpane);

    listModel = new DefaultListModel<String>();
    list = new JList(listModel);
    JScrollPane listScroll = new JScrollPane(list);

    JScrollPane formScroll = new JScrollPane(formEntry);

    JPanel formSplit = new JPanel();
    formSplit.setLayout(new BoxLayout(formSplit, BoxLayout.LINE_AXIS));
    formSplit.add(listScroll);
    formSplit.add(formScroll);

    leftTabbedPane.add("Form Entry", formSplit);

    JTabbedPane rightTabbedPane = new JTabbedPane();
    fieldHelp = new FieldHelp(batchState);
    JScrollPane helpScroll = new JScrollPane(fieldHelp);
    helpScroll.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);

    ImageNavigation imageNavigation = new ImageNavigation();
    rightTabbedPane.add("Field Help", helpScroll);
    rightTabbedPane.add("Image Navigation", imageNavigation);

    horizontalSplitPane =
        new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, leftTabbedPane, rightTabbedPane);
    horizontalSplitPane.setAlignmentX(Component.CENTER_ALIGNMENT);
    horizontalSplitPane.setDividerLocation(this.getWidth() / 2);
    horizontalSplitPane.setOneTouchExpandable(true);
    horizontalSplitPane.setResizeWeight(0.5);

    this.imageComponent = new ImageComponent();

    componentPanel = new JPanel();
    // componentPanel.setBackground(Color.gray);
    // componentPanel.setPreferredSize(new Dimension(400,400));
    component = new DrawingComponent(this, batchState);
    componentPanel.add(component, BorderLayout.CENTER);

    //		slider = new JSlider(1, 100, 20);
    //		slider.addChangeListener(sliderChangeListener);
    //		componentPanel.add(slider, BorderLayout.SOUTH);

    verticalSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, component, horizontalSplitPane);
    verticalSplitPane.setDividerLocation(this.getHeight() / 2);
    verticalSplitPane.setOneTouchExpandable(true);
    verticalSplitPane.setAlignmentX(Component.CENTER_ALIGNMENT);
    verticalSplitPane.setResizeWeight(0.5);

    contentPane.add(verticalSplitPane);

    this.pack();
  }