Exemple #1
0
  protected JComponent createMasterPanel() {
    final FormLayout layout =
        new FormLayout(
            "l:p,2dlu,f:max(p;50dlu):g(.3) ,3dlu " + "l:p,2dlu,f:max(p;50dlu):g(.3) ", "");
    final DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    builder.setDefaultDialogBorder();
    builder.setRowGroupingEnabled(true);
    builder.append("Fecha", fecha);
    builder.append("F. Pago", formaDePago, true);
    builder.append("Banco", bancoOrigen);
    builder.append("Referencia", referencia, true);
    builder.append("Cuenta Depósito", cuentaDeposito, true);
    builder.append("Importe", importe);
    builder.append("Pago", buildPagosbox(model.getPagoMPModel().getModel("depositoRow")), true);
    builder.append("Disponible", disponible);
    builder.append("Por pagar", saldoTotal);
    builder.append("Pendiente", saldoPendiente, true);

    final CellConstraints cc = new CellConstraints();
    builder.append("Comentario");
    builder.appendRow(new RowSpec("17dlu"));
    builder.add(new JScrollPane(comentario), cc.xywh(builder.getColumn(), builder.getRow(), 5, 2));
    builder.nextLine(2);
    builder.append("Condonar", condonar);
    builder.append("Tipo de Facturas", tipoDoctos, true);
    ComponentUtils.decorateSpecialFocusTraversal(builder.getPanel());
    return builder.getPanel();
  }
Exemple #2
0
  public UpdateEdge(Edge edge, NetList netzListe, GraphView control) {
    super(
        netzListe.control.parent,
        "Updating Edge from node " + edge.from.getName() + " to " + edge.to.getName(),
        true);
    this.control = control;
    this.edge = edge;
    this.netzListe = netzListe;
    String cols = "5dlu, fill:pref:grow, 5dlu, fill:pref:grow, 5dlu";
    String rows = "5dlu, fill:pref:grow, 5dlu, pref, 5dlu";

    FormLayout layout = new FormLayout(cols, rows);
    getContentPane().setLayout(layout);
    CellConstraints cc = new CellConstraints();

    tabbedPane.addTab("Weight & Anchor", getMainPanel());
    tabbedPane.addTab("Further Attributes", getSubPanel());
    getContentPane().add(tabbedPane, cc.xyw(1, 2, 5));

    jbDelete.addActionListener(this);
    getContentPane().add(jbDelete, cc.xy(2, 4));

    jb.addActionListener(this);
    getContentPane().add(jb, cc.xy(4, 4));

    pack();
    setSize(Math.max(this.getSize().width, 450), this.getSize().height);
    this.setLocation(300, 300);
    setVisible(true);
  }
Exemple #3
0
  protected JPanel getMainPanel() {
    JPanel panel = new JPanel();
    String cols = "5dlu, fill:pref:grow, 5dlu, fill:pref:grow, 5dlu";
    String rows = "5dlu, pref, 5dlu, pref, 5dlu";

    FormLayout layout = new FormLayout(cols, rows);
    panel.setLayout(layout);
    CellConstraints cc = new CellConstraints();

    panel.add(new JLabel("Weight for edge:"), cc.xy(2, 2));

    String text = edge.getWS();

    tf = new JTextField(text);
    tf.addActionListener(this);
    panel.add(tf, cc.xy(4, 2));

    jcbAnchored.addActionListener(this);
    jcbAnchored.setSelected(edge.isFixed());
    if (!Configuration.getInstance().getGeneralConfig().getUnAnchor()) {
      panel.add(jcbAnchored, cc.xyw(2, 4, 3));
    }

    return panel;
  }
  private JPanel pracownikPanel() {
    FormLayout layout3 = new FormLayout("734", "15px, 485px");

    pracownikPanel = new JPanel(layout3);
    // pracownikPanel= new FormDebugPanel(layout3);
    CellConstraints cc = new CellConstraints();
    JLabel labell = new JLabel("Wyloguj");
    labell.addMouseListener(
        new MouseAdapter() {
          public void mousePressed(MouseEvent me) {
            CardLayout c1 = (CardLayout) (utworzPanel.getLayout());
            c1.show(utworzPanel, "card1");
            tx1.setText("");
            tx2.setText("");
          }
        });

    Color c = new Color(153, 180, 209);
    pracownikPanel.setBackground(c);
    tabbedPane2 = new JTabbedPane(JTabbedPane.LEFT);
    tabbedPane2.setBorder(null);
    tabbedPane2.addTab("Raport", new ImageIcon("images/spotkania.png"), new Raport());
    Font font = new Font("Arial", Font.BOLD, 15);
    tabbedPane2.setFont(font);

    tabbedPane2.setBackground(c);

    pracownikPanel.add(tabbedPane2, cc.xy(1, 2));
    pracownikPanel.add(labell, cc.xy(1, 1, CellConstraints.RIGHT, CellConstraints.TOP));
    return pracownikPanel;
  }
  /**
   * Builds the panel. Initializes and configures components first, then creates a FormLayout,
   * configures the layout, creates a builder, sets a border, and finally adds the components.
   *
   * @return the built panel
   */
  public JComponent createContentPanel() {
    FormLayout layout =
        new FormLayout(
            "p,3dlu,p,3dlu", // cols //$NON-NLS-1$
            "p,10dlu,p,10dlu"); // rows //$NON-NLS-1$

    // Create a builder that assists in adding components to the container.
    // Wrap the panel with a standardized border.
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    builder.setDefaultDialogBorder();

    CellConstraints cc = new CellConstraints();
    JEditorPane l = new JEditorPane("text/html", Messages.getString("LicenseDialog.Email"));
    l.setEditable(false);
    l.setOpaque(false);
    l.setFont(l.getFont().deriveFont(Font.PLAIN));
    JLabel emailLabel = new JLabel(Messages.getString("LicenseDialog.EmailLabel") + ":");
    // emailLabel.setFont(emailLabel.getFont().deriveFont(Font.PLAIN));
    builder.add(l, cc.xyw(1, 1, 4));
    builder.nextLine(2);
    builder.append(emailLabel, email);
    builder.nextLine(2);

    JComponent result = builder.getPanel();
    return result;
  }
 private JPanel doLevelLayout() {
   final FormLayout layout = new FormLayout("5dlu, fill:default:grow, 5dlu", "5dlu, pref, 5dlu");
   final PanelBuilder builder = ComponentFactory.createBuilder(layout);
   final CellConstraints cc = new CellConstraints();
   builder.add(levelComboBox, cc.xy(2, 2));
   return ComponentFactory.createPanel(builder);
 }
  public JPanel createPanel() {
    JPanel jpanel1 = new JPanel();
    FormLayout formlayout1 =
        new FormLayout(
            "FILL:7DLU:NONE,RIGHT:MAX(65DLU;DEFAULT):NONE,FILL:3DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:7DLU:NONE",
            "CENTER:9DLU:NONE,FILL:DEFAULT:GROW(1.0),CENTER:9DLU:NONE");
    CellConstraints cc = new CellConstraints();
    jpanel1.setLayout(formlayout1);

    _envVarsTextArea.setName("envVarsTextArea");
    JScrollPane jscrollpane1 = new JScrollPane();
    jscrollpane1.setViewportView(_envVarsTextArea);
    jscrollpane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
    jscrollpane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    jpanel1.add(jscrollpane1, cc.xy(4, 2));

    _envVarsLabel.setName("envVarsLabel");
    _envVarsLabel.setText(Messages.getString("setVariables"));
    jpanel1.add(
        _envVarsLabel,
        new CellConstraints(2, 2, 1, 1, CellConstraints.DEFAULT, CellConstraints.TOP));

    addFillComponents(jpanel1, new int[] {1, 2, 3, 4, 5}, new int[] {1, 2, 3});
    return jpanel1;
  }
  @Override
  public void prepare() {
    d_pm.rebuildArmSelection();

    removeAll();

    FormLayout layout = new FormLayout("3dlu, left:pref, 3dlu, pref:grow", "p");
    PanelBuilder builder = new PanelBuilder(layout);
    builder.setDefaultDialogBorder();
    CellConstraints cc = new CellConstraints();

    int row = 1;
    for (Study curStudy : d_pm.getSelectableStudyListPM().getSelectedStudiesModel()) {
      builder.addSeparator(curStudy.toString(), cc.xyw(1, row, 4));
      row = LayoutUtil.addRow(layout, row);

      for (TreatmentDefinition def : d_pm.getSelectedRefinedTreatmentDefinitions()) {
        if (!d_pm.getArmsPerStudyPerDefinition(curStudy, def).isEmpty()) {
          row = createArmSelect(builder, row, curStudy, def, cc);
        }
      }
    }

    JScrollPane sp = new JScrollPane(builder.getPanel());
    add(sp, BorderLayout.CENTER);
    sp.getVerticalScrollBar().setUnitIncrement(16);

    setComplete(true);
  }
  private JPanel createComponent() {
    JPanel panel = PanelFactory.createDialogPanel("p, 4dlu, p", "p");
    CellConstraints cc = new CellConstraints();
    panel.add(combobox.getComponent(), cc.xy(1, 1));
    panel.add(
        ButtonFactory.newCleanButton(
            ResourceUtility.getIcon("/uk/ac/ebi/chemet/render/images/cutout/browse_16x16.png"),
            new AbstractAction() {
              @Override
              public void actionPerformed(ActionEvent e) {

                int choice = chooser.showOpenDialog(component);

                if (choice == JFileChooser.APPROVE_OPTION) {
                  File file = chooser.getSelectedFile();
                  try {

                    Reconstruction reconstruction = ReconstructionIOHelper.read(file);

                    DefaultReconstructionManager.getInstance().addReconstruction(reconstruction);
                    combobox.refresh();
                    combobox.setSelected(reconstruction);

                  } catch (IOException ex) {
                    ex.printStackTrace();
                  } catch (ClassNotFoundException ex) {
                    ex.printStackTrace();
                  }
                }
              }
            },
            "Open a reconstruction from disk"),
        cc.xy(3, 1));
    return panel;
  }
  private JPanel buildFilePropertyPreferencesPanel() {
    FormLayout layout =
        new FormLayout(
            "5px, f:p:g, 15px, f:p:g, 15px, f:p:g, 15px, f:p:g, 15px, f:p:g, 15px, f:p:g, 5px",
            "5px, t:p, 15px, t:p, 15px, t:p, 5px");
    PanelBuilder builder = new PanelBuilder(layout);
    builder.setBorder(new TitledBorder("Properties"));
    builder.setOpaque(true);

    CellConstraints cc = new CellConstraints();

    if (fssps != null) {
      // create grid with file types and engine names
      int index = 0;
      int x = 0;
      int y = 0;
      for (FileScannerSelectorPanel fssp : fssps) {
        if (index % 6 == 0) {
          x = 2;
          y += 2;
        }

        builder.add(fssp, cc.xy(x, y));
        x += 2;

        index++;
      }
    } else {
      log.warn(
          "No FileSelectorPanels will be added because fpps is null. This should never happen!");
    }

    return builder.getPanel();
  }
Exemple #11
0
  private Component buildMainPanel() {
    FormLayout layout =
        new FormLayout("pref, $lcgap, pref, 15dlu, p", "p, 5dlu, p, 5dlu, p, 5dlu, p");
    PanelBuilder builder = new PanelBuilder(layout);

    builder.setDefaultDialogBorder();
    builder.setOpaque(false);

    CellConstraints cc = new CellConstraints();

    builder.addSeparator(entity.getId(), cc.xyw(1, 1, 3));
    builder.addLabel("Start", cc.xy(1, 3));
    builder.add(jtflStart, cc.xy(3, 3));
    builder.addLabel("End", cc.xy(1, 5));
    builder.add(jtflEnd, cc.xy(3, 5));
    builder.addLabel("Increment", cc.xy(1, 7));
    builder.add(jtflInc, cc.xy(3, 7));

    builder.add(jbtnOK, cc.xy(5, 1));
    builder.add(jbtnCancel, cc.xy(5, 3));

    JPanel panel = builder.getPanel();
    panel.setOpaque(false);

    return panel;
  }
  private Component buildTagsPanel() {
    FormLayout layout =
        new FormLayout(
            "5px, p, 10px, p, 10px, p, 10px, p, 10px, p, 10px, p, 10px, p, 10px, p, 10px, p, 10px, p, 5px",
            "f:130, 5px");
    PanelBuilder builder = new PanelBuilder(layout);
    builder.setBorder(new TitledBorder("Tags"));
    builder.setOpaque(true);

    CellConstraints cc = new CellConstraints();

    int x = 2;
    int y = 1;
    for (String engineName : lTagsPerEngine.keySet()) {
      if (x > 20) {
        break;
      }

      JScrollPane sp = new JScrollPane(lTagsPerEngine.get(engineName));
      sp.setBorder(BorderFactory.createEmptyBorder());

      JPanel p = new JPanel(new BorderLayout(0, 3));
      p.add(new JHeader(engineName), BorderLayout.NORTH);
      p.add(sp, BorderLayout.CENTER);

      builder.add(p, cc.xy(x, y));
      x += 2;
    }

    return builder.getPanel();
  }
  public VariableNameDialog(JFrame parent, String name) {
    super(parent, "R object name", true);
    setLocationRelativeTo(parent);
    this.parent = parent;

    String cols = "5dlu, pref, 5dlu, fill:pref:grow, 5dlu, pref, 5dlu";
    String rows = "5dlu, pref, 5dlu, pref, 5dlu, pref, 5dlu, pref, 5dlu";

    FormLayout layout = new FormLayout(cols, rows);
    getContentPane().setLayout(layout);
    CellConstraints cc = new CellConstraints();

    int row = 2;

    jt.setText(name);
    jt.addActionListener(this);
    getContentPane().add(new JLabel("R object name:"), cc.xy(2, row));
    getContentPane().add(jt, cc.xyw(4, row, 3));

    row += 2;

    getContentPane().add(ok, cc.xy(6, row));
    ok.addActionListener(this);

    actionPerformed(null);

    pack();
    setVisible(true);
  }
  /**
   * Creates group item.
   *
   * @param name name.
   * @param tooltip tooltip.
   * @param color1 first background color.
   * @param color2 second background color.
   */
  public ResultGroupPanel(String name, String tooltip, Color color1, Color color2) {
    backgroundColor1 = color1;
    backgroundColor2 = color2;

    moreItem = new MoreItem();
    lbCount = new JLabel("0");

    setLayout(new FormLayout("5px, 10px, 5px, 50px:grow, 5px, 30px, 5px", "2px, p, 2px"));
    CellConstraints cc = new CellConstraints();

    GroupCollapseIcon icon = new GroupCollapseIcon();
    icon.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    add(icon, cc.xy(2, 2));

    Font fnt = new Font("Lucida Grande", Font.BOLD, 12);
    lbTitle = new JLabel(name);
    lbTitle.setFont(fnt);
    lbTitle.setForeground(Color.WHITE);
    lbCount.setFont(fnt);
    lbCount.setForeground(Color.WHITE);
    lbCount.setAlignmentX(0.5f);
    add(lbTitle, cc.xy(4, 2));
    add(lbCount, cc.xy(6, 2));

    setBackground(backgroundColor1);
    if (tooltip != null) setToolTipText(tooltip);
  }
  @Override
  public JComponent config() {
    FormLayout layout =
        new FormLayout("left:pref, 0:grow", "p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, 0:grow");
    PanelBuilder builder = new PanelBuilder(layout);
    builder.setBorder(Borders.EMPTY_BORDER);
    builder.setOpaque(false);

    CellConstraints cc = new CellConstraints();

    JComponent cmp = builder.addSeparator("Audio settings", cc.xyw(2, 1, 1));
    cmp = (JComponent) cmp.getComponent(0);
    cmp.setFont(cmp.getFont().deriveFont(Font.BOLD));

    noresample = new JCheckBox(Messages.getString("TrTab2.22"));
    noresample.setContentAreaFilled(false);
    noresample.setSelected(configuration.isAudioResample());
    noresample.addItemListener(
        new ItemListener() {
          public void itemStateChanged(ItemEvent e) {
            configuration.setAudioResample(e.getStateChange() == ItemEvent.SELECTED);
          }
        });
    builder.add(noresample, cc.xy(2, 3));

    return builder.getPanel();
  }
  @Override
  public JComponent config() {
    FormLayout layout =
        new FormLayout("left:pref, 3dlu, p, 3dlu, 0:grow", "p, 3dlu, p, 3dlu, 0:grow");
    PanelBuilder builder = new PanelBuilder(layout);
    builder.setBorder(Borders.EMPTY_BORDER);
    builder.setOpaque(false);

    CellConstraints cc = new CellConstraints();

    JComponent cmp = builder.addSeparator(Messages.getString("NetworkTab.5"), cc.xyw(1, 1, 5));
    cmp = (JComponent) cmp.getComponent(0);
    cmp.setFont(cmp.getFont().deriveFont(Font.BOLD));

    builder.addLabel(Messages.getString("FFMpegDVRMSRemux.0"), cc.xy(1, 3));
    altffpath = new JTextField(PMS.getConfiguration().getFfmpegAlternativePath());
    altffpath.addKeyListener(
        new KeyListener() {
          @Override
          public void keyPressed(KeyEvent e) {}

          @Override
          public void keyTyped(KeyEvent e) {}

          @Override
          public void keyReleased(KeyEvent e) {
            PMS.getConfiguration().setFfmpegAlternativePath(altffpath.getText());
          }
        });
    builder.add(altffpath, cc.xyw(3, 3, 3));

    return builder.getPanel();
  }
  private void createReplacePanel() {
    if (!table.isReadOnly()) {
      replaceField.setColumns(textFieldLength);
      replaceField.addKeyListener(new FindReplaceTextFieldKeyAdapter());

      replaceButton = createButton(getResourceString("SS_SR_REPLACE"));
      replaceButton.addActionListener(replaceAction);

      replaceAllButton = createButton(getResourceString("SS_SR_REPLACEALL"));
      replaceAllButton.addActionListener(replaceAction);

      // replaceButton.setMnemonic(KeyEvent.VK_N);
      // replaceButton.addActionListener(searchAction);
      // JComponent[] itemSample = { new JMenuItem("Replace"), new JMenuItem("Replace All") };
      // memoryReplaceButton = new MemoryDropDownButton("Replace",
      // IconManager.getIcon("DropDownArrow"),
      // 1, java.util.Arrays.asList(itemSample));
      // memoryReplaceButton.setOverrideBorder(true, memoryReplaceButton.raisedBorder);
      // memoryReplaceButton.setEnabled(false);

      builder.add(replaceField, cc.xy(5, 3));
      builder.add(replaceButton, cc.xy(7, 3));
      builder.add(replaceAllButton, cc.xy(9, 3));
    }
  }
  private void initView() {
    cancelButton = new JButton("Cancel");
    proceedButton = new JButton("Continue");

    attributesTable = new JTable();

    // assemble
    CellConstraints cc = new CellConstraints();
    PanelBuilder builder =
        new PanelBuilder(new FormLayout("fill:200dlu:grow", "pref, 3dlu, top:40dlu:grow"));

    builder.setDefaultDialogBorder();

    builder.addLabel("Select actions for duplicated attributes:", cc.xy(1, 1));
    builder.add(new JScrollPane(attributesTable), cc.xy(1, 3));

    JPanel buttons = new JPanel(new FlowLayout(FlowLayout.RIGHT));
    buttons.add(cancelButton);
    buttons.add(proceedButton);

    getContentPane().setLayout(new BorderLayout());
    getContentPane().add(builder.getPanel(), BorderLayout.CENTER);
    getContentPane().add(buttons, BorderLayout.SOUTH);

    // TODO: use preferences
    setSize(450, 350);
  }
  /**
   * Adds fill components to empty cells in the first row and first column of the grid. This ensures
   * that the grid spacing will be the same as shown in the designer.
   *
   * @param cols an array of column indices in the first row where fill components should be added.
   * @param rows an array of row indices in the first column where fill components should be added.
   */
  void addFillComponents(Container panel, int[] cols, int[] rows) {
    Dimension filler = new Dimension(10, 10);

    boolean filled_cell_11 = false;
    CellConstraints cc = new CellConstraints();
    if (cols.length > 0 && rows.length > 0) {
      if (cols[0] == 1 && rows[0] == 1) {
        /** add a rigid area */
        panel.add(Box.createRigidArea(filler), cc.xy(1, 1));
        filled_cell_11 = true;
      }
    }

    for (int index = 0; index < cols.length; index++) {
      if (cols[index] == 1 && filled_cell_11) {
        continue;
      }
      panel.add(Box.createRigidArea(filler), cc.xy(cols[index], 1));
    }

    for (int index = 0; index < rows.length; index++) {
      if (rows[index] == 1 && filled_cell_11) {
        continue;
      }
      panel.add(Box.createRigidArea(filler), cc.xy(1, rows[index]));
    }
  }
 /**
  * Dumps the component constraints to the console.
  *
  * @param container the layout container to inspect
  */
 public static void dumpConstraints(Container container) {
   System.out.println("COMPONENT CONSTRAINTS");
   if (!(container.getLayout() instanceof FormLayout)) {
     System.out.println("The container's layout is not a FormLayout.");
     return;
   }
   FormLayout layout = (FormLayout) container.getLayout();
   int childCount = container.getComponentCount();
   for (int i = 0; i < childCount; i++) {
     Component child = container.getComponent(i);
     CellConstraints cc = layout.getConstraints(child);
     String ccString = cc == null ? "no constraints" : cc.toShortString(layout);
     System.out.print(ccString);
     System.out.print("; ");
     String childType = child.getClass().getName();
     System.out.print(childType);
     if (child instanceof JLabel) {
       JLabel label = (JLabel) child;
       System.out.print("      \"" + label.getText() + "\"");
     }
     if (child.getName() != null) {
       System.out.print("; name=");
       System.out.print(child.getName());
     }
     System.out.println();
   }
   System.out.println();
 }
 private JPanel kibicPanel() {
   FormLayout layout3 = new FormLayout("730", "15px, 485px");
   kibicPanel = new JPanel(layout3);
   // kibicPanel = new FormDebugPanel(layout3);
   CellConstraints cc = new CellConstraints();
   JLabel labell = new JLabel("Wyloguj");
   labell.addMouseListener(
       new MouseAdapter() {
         public void mousePressed(MouseEvent me) {
           CardLayout c1 = (CardLayout) (utworzPanel.getLayout());
           c1.show(utworzPanel, "card1");
           tx1.setText("");
           tx2.setText("");
         }
       });
   Color c = new Color(153, 180, 209);
   kibicPanel.setBackground(c);
   tabbedPane = new JTabbedPane(JTabbedPane.LEFT);
   tabbedPane.setBorder(null);
   tabbedPane.addTab("Spotkania", new ImageIcon("images/spotkania.png"), new Spotkania());
   Font font = new Font("Arial", Font.BOLD, 15);
   tabbedPane.setFont(font);
   tabbedPane.addTab("Król strzelców", new ImageIcon("images/krol.png"), new KrolStrzelcow());
   tabbedPane.addTab("Ranking drużyn", new ImageIcon("images/ranking.png"), new RankingDruzyn());
   // tabbedPane.addTab("")
   tabbedPane.setBackground(c);
   kibicPanel.add(tabbedPane, cc.xy(1, 2));
   kibicPanel.add(labell, cc.xy(1, 1, CellConstraints.RIGHT, CellConstraints.TOP));
   return kibicPanel;
 }
  private int createArmSelect(
      PanelBuilder builder,
      int row,
      final Study curStudy,
      TreatmentDefinition def,
      CellConstraints cc) {
    builder.addLabel(def.getLabel(), cc.xy(2, row));

    ListModel arms = d_pm.getArmsPerStudyPerDefinition(curStudy, def);

    final JComboBox drugBox =
        AuxComponentFactory.createBoundComboBox(
            arms, d_pm.getSelectedArmModel(curStudy, def), true);
    if (arms.getSize() == 1) drugBox.setEnabled(false);
    final JPanel drugAndDosePanel = new JPanel(new BorderLayout());

    builder.add(drugBox, cc.xy(4, row));
    drugBox.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent e) {
            updateDrugAndDoseLabel(curStudy, drugBox, drugAndDosePanel);
          }
        });
    row = LayoutUtil.addRow(builder.getLayout(), row);
    updateDrugAndDoseLabel(curStudy, drugBox, drugAndDosePanel);
    builder.add(drugAndDosePanel, cc.xy(4, row));

    return LayoutUtil.addRow(builder.getLayout(), row);
  }
  private void prepareComponent() {
    CloseEventHandler closeEventHandler = new CloseEventHandler();
    addWindowListener(closeEventHandler);

    Container contentPane = getContentPane();
    contentPane.setLayout(new BorderLayout());

    JPanel contentPanel = new JPanel();
    // JPanel contentPanel = new FormDebugPanel();
    contentPane.add(contentPanel, BorderLayout.CENTER);

    CellConstraints cc = new CellConstraints();
    FormLayout layout =
        new FormLayout(
            "4dlu, d:grow, 4dlu", // columns
            "4dlu, p, 2dlu, fill:100dlu:grow, 4dlu, "
                + // rows
                "p, 2dlu, p, 4dlu"); // btn rows
    PanelBuilder contentPB = new PanelBuilder(layout, contentPanel);
    int columnCount = layout.getColumnCount();
    int rowCount = layout.getRowCount();

    JLabel label = new JLabel(Localizer.getString("MediaTypeCondEditor_ConditionToAdd"));
    contentPB.add(label, cc.xywh(2, 2, 1, 1));

    mediaTypeModel = new MediaTypeModel();
    mediaTypeTable = new JTable(mediaTypeModel);
    JTableHeader tableHeader = mediaTypeTable.getTableHeader();
    tableHeader.setResizingAllowed(false);
    tableHeader.setReorderingAllowed(false);
    // adjust column witdh of checkbox
    JCheckBox box = (JCheckBox) mediaTypeTable.getDefaultRenderer(Boolean.class);
    TableColumn column = mediaTypeTable.getColumnModel().getColumn(0);
    column.setMaxWidth(box.getPreferredSize().width + 2);
    column.setMinWidth(box.getPreferredSize().width + 2);
    mediaTypeTable.getColumnModel().getColumn(1).setCellRenderer(new MediaTypeCellRenderer());
    // ToolTipManager.sharedInstance().registerComponent( mediaTypeTable );
    contentPB.add(new JScrollPane(mediaTypeTable), cc.xywh(2, 4, 1, 1));

    // button bar
    contentPB.add(new JSeparator(), cc.xywh(1, rowCount - 3, columnCount, 1));

    JButton okBtn = new JButton(Localizer.getString("OK"));
    okBtn.addActionListener(new OkBtnListener());
    okBtn.setDefaultCapable(true);
    okBtn.setRequestFocusEnabled(true);

    JButton cancelBtn = new JButton(Localizer.getString("Cancel"));
    cancelBtn.addActionListener(closeEventHandler);

    JPanel btnPanel = ButtonBarFactory.buildOKCancelBar(okBtn, cancelBtn);
    contentPB.add(btnPanel, cc.xywh(2, rowCount - 1, columnCount - 2, 1));

    setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
    getRootPane().setDefaultButton(okBtn);

    pack();
    setLocationRelativeTo(getParent());
  }
Exemple #24
0
  public Gutachten() {
    super();
    // gutachten = this;
    setOpaque(false);
    setLayout(new BorderLayout());
    /** ******zuerst das Leere Panel basteln************* */
    leerPanel = new KeinRezept("noch keine Gutachten angelegt für diesen Patient");
    leerPanel.setName("leerpanel");
    leerPanel.setOpaque(false);

    /** ******dann das volle************* */
    JXPanel allesrein = new JXPanel(new BorderLayout());
    allesrein.setOpaque(false);
    allesrein.setBorder(null);

    FormLayout lay =
        new FormLayout("5dlu,fill:0:grow(1.00),0dlu", "0dlu,p,2dlu,p,2dlu,fill:0:grow(1.00),5dlu");
    CellConstraints cc = new CellConstraints();
    allesrein.setLayout(lay);

    wechselPanel = new JXPanel(new BorderLayout());
    wechselPanel.setOpaque(false);
    wechselPanel.setBorder(null);
    wechselPanel.add(leerPanel, BorderLayout.CENTER);
    aktPanel = "leerPanel";

    allesrein.add(getToolbar(), cc.xy(2, 2));
    // allesrein.add(getTabelle(),cc.xy(2, 4));
    allesrein.add(wechselPanel, cc.xy(2, 6));

    add(JCompTools.getTransparentScrollPane(allesrein), BorderLayout.CENTER);
    validate();
    new Thread() {
      public void run() {
        new SwingWorker<Void, Void>() {

          @Override
          protected Void doInBackground() throws Exception {

            // TODO Auto-generated method stub
            vollPanel = new JXPanel();
            FormLayout vplay =
                new FormLayout("5dlu,fill:0:grow(1.00),5dlu", "13dlu,fill:0:grow(1.00),5dlu");
            // FormLayout vplay = new
            // FormLayout("5dlu,fill:0:grow(1.00),5dlu","5dlu,fill:0:grow(1.00),5dlu");
            CellConstraints vpcc = new CellConstraints();
            vollPanel.setLayout(vplay);
            vollPanel.setOpaque(false);
            vollPanel.setBorder(null);
            anzahlGutachten = new JLabel("Anzahl sozialmed. Gutachten: 0");
            vollPanel.add(anzahlGutachten, vpcc.xy(2, 1));
            vollPanel.add(getGutachtenTbl(), vpcc.xy(2, 2));

            return null;
          }
        }.execute();
      }
    }.start();
  }
 /**
  * Adds a new row to this object's content area.
  *
  * @param cc the cell constraints of the new row
  * @param labelStr the text label for the new row
  * @param column the starting column number for the new row's UI
  * @param row the row number of the new row
  * @return the {@link JTextField} added to the new row
  */
 protected JTextField addRow(
     final CellConstraints cc, final String labelStr, final int column, final int row) {
   add(createI18NFormLabel(labelStr), cc.xy(column, row)); // $NON-NLS-1$
   JTextField tf = createTextField();
   tf.setEditable(false);
   add(tf, cc.xy(column + 2, row));
   return tf;
 }
  public AnchorPointClassificationPanel(
      Object displacement, String title, List<QualifiedName> properties) {
    this.title = title;

    fixed = new JRadioButton();
    property = new JRadioButton();

    ButtonGroup bg = new ButtonGroup();
    bg.add(fixed);
    bg.add(property);

    propertyCBx = new JComboBox();
    propertyCBx.setRenderer(new PropertyNameRenderer());
    for (QualifiedName qn : properties) {
      propertyCBx.addItem(new PropertyName(qn));
    }
    propertyCBy = new JComboBox();
    propertyCBy.setRenderer(new PropertyNameRenderer());
    for (QualifiedName qn : properties) {
      propertyCBy.addItem(new PropertyName(qn));
    }

    anchorEditor = new AnchorEditor();

    if (displacement instanceof Pair<?, ?>) {
      property.setSelected(true);
      propertyCBx.setSelectedItem(((Pair<?, ?>) displacement).first);
      propertyCBy.setSelectedItem(((Pair<?, ?>) displacement).second);
    } else if (displacement instanceof Point2d) {
      fixed.setSelected(true);
      anchorEditor.setValue(((Point2d) displacement).x, ((Point2d) displacement).y);
    } else {
      fixed.setSelected(true);
    }
    if (properties == null || properties.isEmpty()) {
      propertyCBx.setEnabled(false);
      propertyCBy.setEnabled(false);
      property.setEnabled(false);
    }

    FormLayout fl =
        new FormLayout(
            "$rgap, 15dlu, left:default:grow(1.0)",
            "$sepheight, center:[20dlu,default], $ug, $sepheight, bottom:10dlu, center:$cpheight, bottom:10dlu,center:$cpheight");
    DefaultFormBuilder builder = new DefaultFormBuilder(fl);
    CellConstraints cc = new CellConstraints();
    builder.addSeparator(get("$MD11713"), cc.xyw(1, 1, 3));
    builder.add(fixed, cc.xy(2, 2));
    builder.add(anchorEditor, cc.xy(3, 2));

    builder.addSeparator(get("$MD11714"), cc.xyw(1, 4, 3));
    builder.add(property, cc.xywh(2, 5, 1, 4));
    builder.addLabel(get("$MD10835"), cc.xy(3, 5));
    builder.add(propertyCBx, cc.xy(3, 6));
    builder.addLabel(get("$MD10836"), cc.xy(3, 7));
    builder.add(propertyCBy, cc.xy(3, 8));
    add(builder.getPanel());
  }
Exemple #27
0
 private JComponent buildMainPanel() {
   final FormLayout layout = new FormLayout("450dlu", "p,3dlu,p,3dlu,p");
   CellConstraints cc = new CellConstraints();
   PanelBuilder builder = new PanelBuilder(layout);
   builder.add(buildFormPanel(), cc.xy(1, 1));
   builder.add(buildGridPanel(), cc.xy(1, 3));
   // builder.add(createValidationView(),cc.xy(1,3))
   return builder.getPanel();
 }
  private void initLayout() {
    setBorder(Borders.createEmptyBorder(ComponentFactoryService.DEFAULT_FORM_BORDER));

    setLayout(new FormLayout("pref, 3dlu, pref", "pref"));
    final CellConstraints cellConstraints = new CellConstraints();

    add(insetLabel, cellConstraints.xy(1, 1));
    add(insetSpinner, cellConstraints.xy(3, 1));
  }
Exemple #29
0
 private JXPanel getContent() {
   FormLayout lay = new FormLayout("fill:0:grow(0.5),fill:0:grow(0.5)", "fill:0:grow(1.0)");
   CellConstraints cc = new CellConstraints();
   content = new JXPanel();
   content.setLayout(lay);
   content.add(getButtonTeil(), cc.xy(1, 1));
   content.add(getTreeTableTeil(), cc.xy(2, 1));
   content.validate();
   return content;
 }
  private void genUI() {
    prepareComponent();
    FormLayout layout = new FormLayout("3dlu:grow, pref, 3dlu:grow", "3dlu:grow, pref, 3dlu:grow");
    PanelBuilder builder = new PanelBuilder(layout);
    CellConstraints cc = new CellConstraints();

    builder.add(mStart, cc.xy(2, 2));
    setLayout(new BorderLayout());
    add(builder.getPanel(), BorderLayout.CENTER);
  }