Package net.laubenberger.bogatyr.view.swing

Examples of net.laubenberger.bogatyr.view.swing.Panel


    password = new PasswordField(localizer.getTooltip(HelperResource.RES_LABEL_UNSCRAMBLE_PASSWORD));

    actionGo = new ActionGo();
    final ActionAbstract actionAbort = new ActionAbort();

    final Panel panel = new Panel(new BorderLayout());
    panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 5, 10));

    // column 1
    final GridBagConstraints gbc = new GridBagConstraints();
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.anchor = GridBagConstraints.NORTH;
    gbc.gridy = 0;
    gbc.gridx = 0;
    gbc.insets = new Insets(5, 10, 5, 10);

    final Panel panelContent = new Panel(new GridBagLayout());

    Label label = new Label(localizer.getValue(HelperResource.RES_LABEL_UNSCRAMBLE_INPUT));
    panelContent.add(label, gbc);

    gbc.gridy++;
    label = new Label(localizer.getValue(HelperResource.RES_LABEL_UNSCRAMBLE_OUTPUT));
    panelContent.add(label, gbc);

    gbc.gridy++;
    label = new Label(localizer.getValue(HelperResource.RES_LABEL_UNSCRAMBLE_CODEC));
    panelContent.add(label, gbc);

    gbc.gridy++;
    label = new Label(localizer.getValue(HelperResource.RES_LABEL_UNSCRAMBLE_PASSWORD));
    panelContent.add(label, gbc);

    // column 2
    gbc.gridx++;
    gbc.gridy = 0;
    gbc.weightx = 1.0D;

    panelContent.add(tfInput, gbc);

    gbc.gridy++;
    panelContent.add(tfOutput, gbc);

    gbc.gridy++;
    cbCodecs.setSelectedItem(scrambler.getModuleData().getValue(KEY_UNSCRAMBLE_ALGO, CryptoSymmetricAlgo.class));
    cbCodecs.addItemListener(new ItemListener() {
      @Override
      public void itemStateChanged(final ItemEvent e) {
        validateGo();
      }
    });
    panelContent.add(cbCodecs, gbc);

    gbc.gridy++;
    password.addKeyListener(new KeyAdapter() {

      @Override
      public void keyTyped(final KeyEvent e) {
        validateGo();
      }
    });
    panelContent.add(password, gbc);

    // column 3
    gbc.gridx++;
    gbc.gridy = 0;
    gbc.weightx = 0.0D;

    panelContent.add(new Button(new ActionInput()), gbc);

    gbc.gridy++;
    panelContent.add(new Button(new ActionOutput()), gbc);

    // spacer
    gbc.gridy = 4;
    gbc.fill = GridBagConstraints.BOTH;
    gbc.weighty = 1.0D;

    panelContent.add(new Panel(), gbc);

    final JScrollPane scroll = new PaneScroll(panelContent);

    final Group group = new Group(new Insets(0, 0, 0, 10), new Button(actionGo), new Button(actionAbort));
View Full Code Here


  private void createLayout() {
    getContentPane().removeAll();

    setTitle(view.getController().getModel().getName() + HelperString.COLON + HelperString.SPACE + localizer.getValue(HelperResource.RES_ACTION_INFO));

    final JPanel panel = new Panel(new BorderLayout());
    panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 5, 10));

    final JTabbedPane tab = new PaneTab();
   
   
   
    final JTable taApplication = new Table(HelperMap.toArray(view.getController().getReport()), new String[]{localizer.getValue(HelperResource.RES_LABEL_KEY), localizer.getValue(HelperResource.RES_LABEL_VALUE)}){
      private static final long serialVersionUID = 5956530506987984746L;

      @Override
      public boolean isCellEditable(final int rowIndex, final int colIndex) {
        return false;
      }
    };
   
    final JScrollPane scrollApplication = new PaneScroll(taApplication);
    tab.addTab(localizer.getValue(HelperResource.RES_LABEL_APPLICATION), view.getController().getScaledIcon(Icon.LOGO), scrollApplication, localizer.getTooltip(HelperResource.RES_LABEL_APPLICATION));

   
   
    final JTable taJava = new Table(HelperMap.toArray(HelperEnvironment.getReportJava()), new String[]{localizer.getValue(HelperResource.RES_LABEL_KEY), localizer.getValue(HelperResource.RES_LABEL_VALUE)}) {
      private static final long serialVersionUID = 5956530506987984746L;

      @Override
      public boolean isCellEditable(final int rowIndex, final int colIndex) {
        return false;
      }
    };

    final JScrollPane scrollJava = new PaneScroll(taJava);
    tab.addTab(localizer.getValue(HelperResource.RES_LABEL_JAVA), view.getController().getScaledIcon(Icon.JAVA), scrollJava, localizer.getTooltip(HelperResource.RES_LABEL_JAVA));

    final JTable taOS = new Table(HelperMap.toArray(HelperEnvironment.getReportOS()), new String[]{localizer.getValue(HelperResource.RES_LABEL_KEY), localizer.getValue(HelperResource.RES_LABEL_VALUE)}) {
      private static final long serialVersionUID = 5956530506987984746L;

      @Override
      public boolean isCellEditable(final int rowIndex, final int colIndex) {
        return false;
      }
    };
   
    final JScrollPane scrollOS = new PaneScroll(taOS);
    final ImageIcon iconOS;
    if (Platform.MAC_OSX == HelperEnvironment.getPlatform()) {
      iconOS = view.getController().getScaledIcon(Icon.MAC);
    } else
      iconOS = Platform.WINDOWS == HelperEnvironment.getPlatform() ? view.getController().getScaledIcon(Icon.WINDOWS) : view.getController().getScaledIcon(Icon.LINUX);
   
    tab.addTab(localizer.getValue(HelperResource.RES_LABEL_OS), iconOS, scrollOS, localizer.getTooltip(HelperResource.RES_LABEL_OS));

   
   
    final JTable taSystem = new Table(HelperMap.toArray(HelperEnvironment.getReportSystem()), new String[]{localizer.getValue(HelperResource.RES_LABEL_KEY), localizer.getValue(HelperResource.RES_LABEL_VALUE)}) {
      private static final long serialVersionUID = -8531838594552715361L;

      @Override
      public boolean isCellEditable(final int rowIndex, final int colIndex) {
        return false;
      }
    };
   
    final JScrollPane scrollSystem = new PaneScroll(taSystem);
    tab.addTab(localizer.getValue(HelperResource.RES_LABEL_SYSTEM), view.getController().getScaledIcon(Icon.SYSTEM), scrollSystem, localizer.getTooltip(HelperResource.RES_LABEL_SYSTEM));


    final JTable taUser = new Table(HelperMap.toArray(HelperEnvironment.getReportUser()), new String[]{localizer.getValue(HelperResource.RES_LABEL_KEY), localizer.getValue(HelperResource.RES_LABEL_VALUE)}){
      private static final long serialVersionUID = 1327561378424760584L;

      @Override
      public boolean isCellEditable(final int rowIndex, final int colIndex) {
        return false;
      }
    };

//    final JTextArea taUser = new TextArea();
//    taUser.setEditable(false);
//    taUser.append(HelperEnvironment.getReportUser());
    final JScrollPane scrollUser = new PaneScroll(taUser);
//    taUser.setCaretPosition(0);
    tab.addTab(localizer.getValue(HelperResource.RES_LABEL_USER), view.getController().getScaledIcon(Icon.USER), scrollUser, localizer.getTooltip(HelperResource.RES_LABEL_USER));

    panel.add(tab, BorderLayout.CENTER);
   
    final Group group = new Group(new Insets(0, 0, 0, 0), new Button(new ActionClose()));
    panel.add(group, BorderLayout.SOUTH);

    getContentPane().add(panel);
//    pack();
  }
View Full Code Here

    password2 = new PasswordField(localizer.getTooltip(HelperResource.RES_LABEL_SCRAMBLE_PASSWORD_VERIFY));

    actionGo = new ActionGo();
    final ActionAbstract actionAbort = new ActionAbort();

    final Panel panel = new Panel(new BorderLayout());
    panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 5, 10));

    // column 1
    final GridBagConstraints gbc = new GridBagConstraints();
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.anchor = GridBagConstraints.NORTH;
    gbc.gridy = 0;
    gbc.gridx = 0;
    gbc.insets = new Insets(5, 10, 5, 10);

    final Panel panelContent = new Panel(new GridBagLayout());

    Label label = new Label(localizer.getValue(HelperResource.RES_LABEL_SCRAMBLE_INPUT));
    panelContent.add(label, gbc);

    gbc.gridy++;
    label = new Label(localizer.getValue(HelperResource.RES_LABEL_SCRAMBLE_OUTPUT));
    panelContent.add(label, gbc);

    gbc.gridy++;
    label = new Label(localizer.getValue(HelperResource.RES_LABEL_SCRAMBLE_CODEC));
    panelContent.add(label, gbc);

    gbc.gridy++;
    label = new Label(localizer.getValue(HelperResource.RES_LABEL_SCRAMBLE_PASSWORD));
    panelContent.add(label, gbc);

    gbc.gridy++;
    label = new Label(localizer.getValue(HelperResource.RES_LABEL_SCRAMBLE_PASSWORD_VERIFY));
    panelContent.add(label, gbc);

    // column 2
    gbc.gridx++;
    gbc.gridy = 0;
    gbc.weightx = 1.0D;

    panelContent.add(tfInput, gbc);

    gbc.gridy++;
    panelContent.add(tfOutput, gbc);

    gbc.gridy++;
    cbCodecs.setSelectedItem(scrambler.getModuleData().getValue(KEY_SCRAMBLE_ALGO, CryptoSymmetricAlgo.class));
    cbCodecs.addItemListener(new ItemListener() {
      @Override
      public void itemStateChanged(final ItemEvent e) {
        validateGo();
      }
    });
    panelContent.add(cbCodecs, gbc);

    gbc.gridy++;
    password1.addKeyListener(new KeyAdapter() {

      @Override
      public void keyTyped(final KeyEvent e) {
        validateGo();
      }
    });
    panelContent.add(password1, gbc);

    gbc.gridy++;
    password2.addKeyListener(new KeyAdapter() {

      @Override
      public void keyTyped(final KeyEvent e) {
        validateGo();
      }
    });
    panelContent.add(password2, gbc);

    // column 3
    gbc.gridx++;
    gbc.gridy = 0;
    gbc.weightx = 0.0D;

    panelContent.add(new Button(new ActionInput()), gbc);

    gbc.gridy++;
    panelContent.add(new Button(new ActionOutput()), gbc);

    // spacer
    gbc.gridy = 5;
    gbc.fill = GridBagConstraints.BOTH;
    gbc.weighty = 1.0D;

    panelContent.add(new Panel(), gbc);

    final JScrollPane scroll = new PaneScroll(panelContent);

    final Group group = new Group(new Insets(0, 0, 0, 10), new Button(actionGo), new Button(actionAbort));
View Full Code Here

    getContentPane().removeAll();

    setTitle(scrambler.getModel().getName() + HelperString.COLON + HelperString.SPACE
        + localizer.getValue(HelperResource.RES_ACTION_ABOUT));

    final Panel panel = new Panel(new BorderLayout());
    panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 5, 10));

    final Panel panelWest = new Panel(new BorderLayout());
    panelWest.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10));

    final Panel panelEast = new Panel(new GridLayout(0, 1));
    panelEast.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 10));

    panelWest.add(new Label(scrambler.getCallback().getScaledIcon(scrambler.getLogo())), BorderLayout.NORTH);

    panelEast.add(new Label(scrambler.getModel().getName() + HelperString.SPACE + scrambler.getModel().getVersion()));
    panelEast.add(new JXTitledSeparator(null));
    panelEast.add(new Label(HelperString.COPYRIGHT + " 2011:"));
    panelEast.add(new Label());
    panelEast.add(new Label("Stefan Laubenberger"));
    panelEast.add(new Label("Bullingerstrasse 53"));
    panelEast.add(new Label("CH-8004 Zürich"));
    panelEast.add(new Label());
    final JXHyperlink link = new JXHyperlink();
    final JXHyperlink mail = new JXHyperlink();
    try {
      link.setURI(new URI(HelperResource.URL));
      mail.setURI(new URI(HelperResource.MAIL));
    } catch (URISyntaxException ex) {
      //should never happen!
      log.error("Invalid URI", ex); //$NON-NLS-1$
    }
    panelEast.add(link);
    panelEast.add(mail);
    panelEast.add(new Label());
   
    panel.add(panelWest, BorderLayout.WEST);
    panel.add(panelEast, BorderLayout.EAST);

    final Group group = new Group(new Insets(0, 0, 0, 0), new Button(new ActionClose()));
View Full Code Here

    getContentPane().removeAll();

    setTitle(test.getModel().getName() + HelperString.COLON + HelperString.SPACE
        + localizer.getValue(HelperResource.RES_ACTION_DATA));

    final Panel panel = new Panel(new BorderLayout());
    panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 5, 10));

    final JTable table = new Table(HelperMap.toArray(entries), new String[] { "id", "created" }) { //$NON-NLS-1$//$NON-NLS-2$
      private static final long serialVersionUID = 1327561378424760584L;

      @Override
      public boolean isCellEditable(final int rowIndex, final int colIndex) {
        return false;
      }
    };

    // final JTextArea ta = new TextArea();
    // ta.setEditable(false);
    // ta.append(entries);
    final JScrollPane scroll = new PaneScroll(table);

    panel.add(scroll, BorderLayout.CENTER);

    final Group group = new Group(new Insets(0, 0, 0, 0), new Button(new ActionClose()));
    panel.add(group, BorderLayout.SOUTH);

    getContentPane().add(panel);
//    pack();
  }
View Full Code Here

    getContentPane().removeAll();

    setTitle(test.getModel().getName() + HelperString.COLON + HelperString.SPACE
        + localizer.getValue(HelperResource.RES_ACTION_DATA));

    final Panel panel = new Panel(new BorderLayout());
    panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 5, 10));

    final JTable table = new Table(HelperMap.toArray(test.getModuleData().getData()), new String[] {
        localizer.getValue(HelperResource.RES_LABEL_KEY), localizer.getValue(HelperResource.RES_LABEL_VALUE) }) {
      private static final long serialVersionUID = 1327561378424760584L;

      @Override
      public boolean isCellEditable(final int rowIndex, final int colIndex) {
        return false;
      }
    };

    // final JTextArea ta = new TextArea();
    // ta.setEditable(false);
    // ta.setWrapStyleWord(false);
    // ta.append(entries);
    final JScrollPane scroll = new PaneScroll(table);

    panel.add(scroll, BorderLayout.CENTER);

    final Group group = new Group(new Insets(0, 0, 0, 0), new Button(new ActionClose()));
    panel.add(group, BorderLayout.SOUTH);

    getContentPane().add(panel);
//    pack();
  }
View Full Code Here

    getContentPane().removeAll();

    setTitle(test.getModel().getName() + HelperString.COLON + HelperString.SPACE
        + localizer.getValue(HelperResource.RES_ACTION_COMPONENTS));

    final Panel panel = new Panel(new BorderLayout());
    panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 5, 10));

    final Panel panelCenter = new Panel(new GridLayout(0, 2, 0, 5));
    panelCenter.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));

    panelCenter.add(new Label("Icon")); //$NON-NLS-1$
    panelCenter.add(new JLabel(test.getCallback().getScaledIcon(test.getLogo())));

    panelCenter.add(new Label("JLabel")); //$NON-NLS-1$
    panelCenter.add(new JLabel("label")); //$NON-NLS-1$

    panelCenter.add(new Label("JTextField")); //$NON-NLS-1$
    panelCenter.add(new JTextField("text field")); //$NON-NLS-1$

    panelCenter.add(new Label("JPasswordField")); //$NON-NLS-1$
    panelCenter.add(new JPasswordField("password field")); //$NON-NLS-1$

    final JProgressBar pb = new JProgressBar();
    pb.setIndeterminate(true);
    panelCenter.add(new Label("JProgressBar")); //$NON-NLS-1$
    panelCenter.add(pb);

    panelCenter.add(new Label("JButton")); //$NON-NLS-1$
    panelCenter.add(new JButton("button")); //$NON-NLS-1$

    panelCenter.add(new Label("JRadioButton")); //$NON-NLS-1$
    panelCenter.add(new JRadioButton("radio button")); //$NON-NLS-1$

    panelCenter.add(new Label("JCheckBox")); //$NON-NLS-1$
    panelCenter.add(new JCheckBox("check box")); //$NON-NLS-1$

    panelCenter.add(new Label("JSlider")); //$NON-NLS-1$
    panelCenter.add(new JSlider(0, 100));

    panelCenter.add(new Label("JSpinner")); //$NON-NLS-1$
    panelCenter.add(new JSpinner());

    panelCenter.add(new Label("JComboBox")); //$NON-NLS-1$
    panelCenter.add(new JComboBox(new String[] { "Value1", "Value2", "Value3" })); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

    panel.add(new PaneScroll(panelCenter), BorderLayout.CENTER);

    final Group group = new Group(new Insets(0, 0, 0, 0), new Button(new ActionClose()));
    panel.add(group, BorderLayout.SOUTH);
View Full Code Here

    getContentPane().removeAll();

    setTitle(test.getModel().getName() + HelperString.COLON + HelperString.SPACE
        + localizer.getValue(HelperResource.RES_ACTION_ABOUT));

    final Panel panel = new Panel(new BorderLayout());
    panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 5, 10));

    final Panel panelCenter = new Panel(new BorderLayout());

    panelCenter.add(new JLabel(test.getCallback().getScaledIcon(Icons.THREAD)), BorderLayout.NORTH);

    text = new Label(getClass().getName());
    panelCenter.add(text, BorderLayout.SOUTH);

    final JBusyComponent<Panel> busyComponent = new JBusyComponent<Panel>(panelCenter);
    panel.add(busyComponent, BorderLayout.CENTER);

    final Group group = new Group(new Insets(0, 0, 0, 0), new Button(new ActionClose()));
View Full Code Here

    getContentPane().removeAll();

    setTitle(test.getModel().getName() + HelperString.COLON + HelperString.SPACE
        + localizer.getValue(HelperResource.RES_ACTION_ABOUT));

    final Panel panel = new Panel(new BorderLayout());
    panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 5, 10));

    final Panel panelWest = new Panel(new BorderLayout());
    panelWest.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10));

    final Panel panelEast = new Panel(new GridLayout(0, 1));
    panelEast.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 10));

    panelWest.add(new Label(test.getCallback().getScaledIcon(test.getLogo())), BorderLayout.NORTH);

    panelEast.add(new Label(test.getModel().getName() + HelperString.SPACE + test.getModel().getVersion()));
    panelEast.add(new JXTitledSeparator(null));
    panelEast.add(new Label(HelperString.COPYRIGHT + " 2010-2011:"));
    panelEast.add(new Label());
    panelEast.add(new Label("Stefan Laubenberger"));
    panelEast.add(new Label("Bullingerstrasse 53"));
    panelEast.add(new Label("CH-8004 Zürich"));
    panelEast.add(new Label());
    final JXHyperlink link = new JXHyperlink();
    final JXHyperlink mail = new JXHyperlink();
    try {
      link.setURI(new URI(HelperResource.URL));
      mail.setURI(new URI(HelperResource.MAIL));
    } catch (URISyntaxException ex) {
      //should never happen!
      log.error("Invalid URI", ex); //$NON-NLS-1$
    }
    panelEast.add(link);
    panelEast.add(mail);
    panelEast.add(new Label());
    panel.add(panelWest, BorderLayout.WEST);
    panel.add(panelEast, BorderLayout.EAST);

    final Group group = new Group(new Insets(0, 0, 0, 0), new Button(new ActionClose()));
    panel.add(group, BorderLayout.SOUTH);
View Full Code Here

    getContentPane().removeAll();

    setTitle(view.getController().getModel().getName() + HelperString.COLON + HelperString.SPACE
        + localizer.getValue(HelperResource.RES_ACTION_HELP));

    final JPanel panel = new Panel(new BorderLayout());
    panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 5, 10));

    final PanelXHtml panelXHtml = new PanelXHtml(getClass().getClassLoader().getResource(
        localizer.getValue(HelperResource.RES_HTML_HELP)));
    panel.add(panelXHtml, BorderLayout.CENTER);

    final Group group = new Group(new Insets(0, 0, 0, 0), new Button(new ActionClose()));
    panel.add(group, BorderLayout.SOUTH);

    getContentPane().add(panel);
  }
View Full Code Here

TOP

Related Classes of net.laubenberger.bogatyr.view.swing.Panel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.