Пример #1
0
  /**
   * Creates a new JTextPane for the code.
   *
   * @return the text pane
   */
  protected JTextPane newCodePane() {
    JTextPane result;
    SyntaxDocument doc;
    Properties props;

    try {
      props = Utils.readProperties(PROPERTIES_FILE);
    } catch (Exception e) {
      e.printStackTrace();
      props = new Properties();
    }

    result = new JTextPane();
    if (props.getProperty("Syntax", "false").equals("true")) {
      doc = new SyntaxDocument(props);
      result.setDocument(doc);
      result.setBackground(doc.getBackgroundColor());
    } else {
      result.setForeground(
          VisualizeUtils.processColour(props.getProperty("ForegroundColor", "black"), Color.BLACK));
      result.setBackground(
          VisualizeUtils.processColour(props.getProperty("BackgroundColor", "white"), Color.WHITE));
      result.setFont(
          new Font(
              props.getProperty("FontName", "monospaced"),
              Font.PLAIN,
              Integer.parseInt(props.getProperty("FontSize", "12"))));
    }

    return result;
  }
  public DisplayArea(final ClassySharkPanel tabPanel) {
    jTextPane = new JTextPane();
    jTextPane.setEditable(false);
    jTextPane.setBackground(ColorScheme.BACKGROUND);

    jTextPane.addMouseListener(
        new MouseAdapter() {
          @Override
          public void mouseClicked(MouseEvent e) {
            if (displayDataState == DisplayDataState.SHARKEY
                || displayDataState == DisplayDataState.INFO) {
              return;
            }

            if (e.getButton() != MouseEvent.BUTTON1) {
              return;
            }

            if (e.getClickCount() != 2) {
              return;
            }

            int offset = jTextPane.viewToModel(e.getPoint());

            try {
              int rowStart = Utilities.getRowStart(jTextPane, offset);
              int rowEnd = Utilities.getRowEnd(jTextPane, offset);
              String selectedLine = jTextPane.getText().substring(rowStart, rowEnd);
              System.out.println(selectedLine);

              if (displayDataState == DisplayDataState.CLASSES_LIST) {
                tabPanel.onSelectedClassName(selectedLine);
              } else if (displayDataState == DisplayDataState.INSIDE_CLASS) {
                if (selectedLine.contains("import")) {
                  tabPanel.onSelectedImportFromMouseClick(
                      getClassNameFromImportStatement(selectedLine));
                } else {

                  rowStart = Utilities.getWordStart(jTextPane, offset);
                  rowEnd = Utilities.getWordEnd(jTextPane, offset);
                  String word = jTextPane.getText().substring(rowStart, rowEnd);

                  tabPanel.onSelectedTypeClassFromMouseClick(word);
                }
              }
            } catch (BadLocationException e1) {
              e1.printStackTrace();
            }
          }

          public String getClassNameFromImportStatement(String selectedLine) {
            final String IMPORT = "import ";
            int start = selectedLine.indexOf(IMPORT) + IMPORT.length();
            String result = selectedLine.trim().substring(start, selectedLine.indexOf(";"));
            return result;
          }
        });

    displaySharkey();
  }
  /**
   * @param logs
   * @param firstOrg
   * @param secondOrg
   * @return
   */
  private ProMSplitPane differentConditionsPanelCreator(
      OrganizationalLogs logs, int firstOrg, int secondOrg) {
    ProMSplitPane splitPanelRefinedActivity = new ProMSplitPane();
    splitPanelRefinedActivity.setBackground(null);

    ProMTable comp = differentConditionsTableCreator(logs, firstOrg, secondOrg);
    if (comp == null) return null;

    JTextPane textField = new JTextPane();
    textField.setContentType("text/html");
    textField.setText(
        fontBlack6
            + "Different Conditions for Occurrence ("
            + comp.getTable().getRowCount()
            + ")</font><hr>"
            + fontBlack4
            + "Set of dependencies are same for two processes; however, occurrence condition is different in organizations. In the list you can see different occurrence conditions in two organizations as "
            + logs.organizationNames.get(firstOrg)
            + "(Selected) and "
            + logs.organizationNames.get(secondOrg)
            + "(Other).");
    textField.setEditable(false);
    textField.setBackground(new Color(192, 192, 192));
    JScrollPane scrollPane = new JScrollPane(textField);
    scrollPane.setPreferredSize(new Dimension(500, 0));

    splitPanelRefinedActivity.setLeftComponent(comp);
    splitPanelRefinedActivity.setRightComponent(scrollPane);
    return splitPanelRefinedActivity;
  }
Пример #4
0
  /** Displays the Spark error log. */
  private void showErrorLog() {
    final File logDir = new File(Spark.getLogDirectory(), "errors.log");

    // Read file and show
    final String errorLogs = URLFileSystem.getContents(logDir);

    final JFrame frame = new JFrame(Res.getString("title.client.logs"));
    frame.setLayout(new BorderLayout());
    frame.setIconImage(SparkManager.getApplicationImage().getImage());

    final JTextPane pane = new JTextPane();
    pane.setBackground(Color.white);
    pane.setFont(new Font("Dialog", Font.PLAIN, 12));
    pane.setEditable(false);
    pane.setText(errorLogs);

    frame.add(new JScrollPane(pane), BorderLayout.CENTER);

    final JButton copyButton = new JButton(Res.getString("button.copy.to.clipboard"));
    frame.add(copyButton, BorderLayout.SOUTH);

    copyButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            SparkManager.setClipboard(errorLogs);
            copyButton.setEnabled(false);
          }
        });

    frame.pack();
    frame.setSize(600, 400);

    GraphicUtils.centerWindowOnScreen(frame);
    frame.setVisible(true);
  }
Пример #5
0
 private void updateDisplay() {
   // first, set block colours
   textView.setBackground(getColour(backgroundColour("text-background-colour")));
   textView.setForeground(getColour(foregroundColour("text-foreground-colour")));
   textView.setCaretColor(getColour(foregroundColour("text-caret-colour")));
   problemsView.setBackground(getColour(backgroundColour("problems-background-colour")));
   problemsView.setForeground(getColour(foregroundColour("problems-foreground-colour")));
   consoleView.setBackground(getColour(backgroundColour("console-background-colour")));
   consoleView.setForeground(getColour(foregroundColour("console-foreground-colour")));
   // second, set colours on the code!
   java.util.List<Lexer.Token> tokens = Lexer.tokenise(textView.getText(), true);
   int pos = 0;
   for (Lexer.Token t : tokens) {
     int len = t.toString().length();
     if (t instanceof Lexer.RightBrace || t instanceof Lexer.LeftBrace) {
       highlightArea(pos, len, foregroundColour("text-brace-colour"));
     } else if (t instanceof Lexer.Strung) {
       highlightArea(pos, len, foregroundColour("text-string-colour"));
     } else if (t instanceof Lexer.Comment) {
       highlightArea(pos, len, foregroundColour("text-comment-colour"));
     } else if (t instanceof Lexer.Quote) {
       highlightArea(pos, len, foregroundColour("text-quote-colour"));
     } else if (t instanceof Lexer.Comma) {
       highlightArea(pos, len, foregroundColour("text-comma-colour"));
     } else if (t instanceof Lexer.Identifier) {
       highlightArea(pos, len, foregroundColour("text-identifier-colour"));
     } else if (t instanceof Lexer.Integer) {
       highlightArea(pos, len, foregroundColour("text-integer-colour"));
     }
     pos += len;
   }
 }
  /**
   * @param logs
   * @param firstOrg
   * @param secondOrg
   * @return
   */
  private ProMSplitPane refinedActivityPanelCreator(
      OrganizationalLogs logs, int firstOrg, int secondOrg) {
    ProMSplitPane splitPanelRefinedActivity = new ProMSplitPane();
    splitPanelRefinedActivity.setBackground(null);

    ProMTable comp = refinedActivityTableCreator(logs, firstOrg, secondOrg);
    if (comp == null) return null;

    JTextPane textField = new JTextPane();
    textField.setContentType("text/html");
    textField.setText(
        fontBlack6
            + "Refined Activities ("
            + comp.getTable().getRowCount()
            + ")</font><hr>"
            + fontBlack4
            + "An activity exists in one process but, as an equivalent, a collection of activitiesare existing in the other process to achieve the same task. In the list you can see the refined activity in "
            + logs.organizationNames.get(firstOrg)
            + " and a potential list of activities in "
            + logs.organizationNames.get(secondOrg)
            + ".");
    textField.setEditable(false);
    textField.setBackground(new Color(192, 192, 192));
    JScrollPane scrollPane = new JScrollPane(textField);
    scrollPane.setPreferredSize(new Dimension(500, 0));

    splitPanelRefinedActivity.setLeftComponent(comp);
    splitPanelRefinedActivity.setRightComponent(scrollPane);
    return splitPanelRefinedActivity;
  }
Пример #7
0
  private void initComponents() {
    accountCombo = new AccountListComboBox();

    helpPane = new JTextPane();
    helpPane.setEditable(false);
    helpPane.setEditorKit(new StyledEditorKit());
    helpPane.setBackground(getBackground());
    helpPane.setText(TextResource.getString("QifOne.txt"));

    /* Create the combo for date format selection */
    String[] formats = {QifUtils.US_FORMAT, QifUtils.EU_FORMAT};
    dateFormatCombo = new JComboBox<>(formats);

    dateFormatCombo.addActionListener(this);
    dateFormatCombo.setSelectedIndex(pref.getInt(DATE_FORMAT, 0));

    accountCombo.addActionListener(this);

    /* Try a set the combobox to the last selected account */
    String lastAccount = pref.get(LAST_ACCOUNT, "");

    Account last = EngineFactory.getEngine(EngineFactory.DEFAULT).getAccountByUuid(lastAccount);

    if (last != null) {
      setAccount(last);
    }
  }
Пример #8
0
 private JTextPane createTextPane(final Font font, final Color color) {
   final JTextPane textPane = new JTextPane();
   textPane.setFont(font);
   textPane.setBackground(color);
   textPane.setEditable(false);
   return textPane;
 }
Пример #9
0
  private JPanel createCentrePanel(YDataStateException exception) {
    JPanel centrePanel = new JPanel(new GridLayout(1, 2));

    JPanel msgPanel = new JPanel(new BorderLayout());
    msgPanel.setBackground(YAdminGUI._apiColour);
    msgPanel.setBorder(
        BorderFactory.createCompoundBorder(
            BorderFactory.createTitledBorder(
                BorderFactory.createEtchedBorder(), "Schema for completing task"),
            BorderFactory.createEmptyBorder(10, 10, 10, 10)));
    JTextPane msgTextPane = new JTextPane();
    msgTextPane.setContentType("text/plain");
    msgTextPane.setFont(new Font("courier", Font.PLAIN, 12));
    msgTextPane.setForeground(Color.RED);

    msgTextPane.setText(exception.getMessage());
    msgTextPane.setEditable(false);
    msgTextPane.setBackground(Color.LIGHT_GRAY);
    JPanel noWrapPanel = new JPanel();
    noWrapPanel.setLayout(new BorderLayout());
    noWrapPanel.add(msgTextPane);
    msgPanel.add(new JScrollPane(noWrapPanel));

    centrePanel.add(msgPanel, BorderLayout.NORTH);
    return centrePanel;
  }
  /**
   * @param logs
   * @param firstOrg
   * @param secondOrg
   * @return
   */
  private ProMSplitPane additionalDependencyPanelCreator(
      OrganizationalLogs logs, int firstOrg, int secondOrg) {
    ProMSplitPane splitPanelRefinedActivity = new ProMSplitPane();
    splitPanelRefinedActivity.setBackground(null);

    ProMTable comp = additionalDependencyTableCreator(logs, firstOrg, secondOrg);
    if (comp == null) return null;

    JTextPane textField = new JTextPane();
    textField.setContentType("text/html");
    textField.setText(
        fontBlack6
            + "Additional Dependencies ("
            + comp.getTable().getRowCount()
            + ")</font><hr>"
            + fontBlack4
            + " This pattern is a special case of different dependencies where one set of activities includes the other and results with additional dependencies. In the list you can see additional dependency sets in two organizations as "
            + logs.organizationNames.get(firstOrg)
            + "(Selected) and "
            + logs.organizationNames.get(secondOrg)
            + "(Other).");
    textField.setEditable(false);
    textField.setBackground(new Color(192, 192, 192));
    JScrollPane scrollPane = new JScrollPane(textField);
    scrollPane.setPreferredSize(new Dimension(500, 0));

    splitPanelRefinedActivity.setLeftComponent(comp);
    splitPanelRefinedActivity.setRightComponent(scrollPane);
    return splitPanelRefinedActivity;
  }
Пример #11
0
 private JTextPane getErrorMessage() {
   if (errorMessage == null) {
     errorMessage = new JTextPane();
     errorMessage.setFont(new Font("Calibri", Font.PLAIN, 18));
     errorMessage.setBackground(new Color(227, 228, 250));
     errorMessage.setBounds(601, 454, 243, 88);
   }
   return errorMessage;
 }
Пример #12
0
 /**
  * This method initializes jTextPane
  *
  * @return javax.swing.JTextPane
  */
 private JTextPane getJTextPane() {
   if (jTextPane == null) {
     jTextPane = new JTextPane();
     jTextPane.setLocation(new Point(554, 231));
     jTextPane.setBackground(new Color(91, 155, 213));
     jTextPane.setSize(new Dimension(1, 300));
   }
   return jTextPane;
 }
Пример #13
0
    @Override
    public Component getListCellRendererComponent(
        final JList list,
        final Object value,
        final int index,
        final boolean isSelected,
        final boolean cellHasFocus) {
      if (!(value instanceof WrappedLogRecord)) {
        return new JLabel();
      }

      final WrappedLogRecord wlr = (WrappedLogRecord) value;

      final JTextPane result = new JTextPane();
      result.setDragEnabled(true);
      result.setText(wlr.formatted);
      result.setComponentOrientation(list.getComponentOrientation());
      result.setFont(list.getFont());
      result.setBorder(cellHasFocus || isSelected ? SELECTED_BORDER : EMPTY_BORDER);

      if (wlr.record.getLevel() == Level.CONFIG) {
        result.setForeground(DARK_BLUE);
      }

      if (wlr.record.getLevel() == Level.SEVERE) {
        result.setBackground(DARK_RED);
        result.setForeground(Color.WHITE);
      }

      if (wlr.record.getLevel() == Level.WARNING) {
        result.setForeground(DARK_RED);
      }

      if (wlr.record.getLevel() == Level.FINE
          || wlr.record.getLevel() == Level.FINER
          || wlr.record.getLevel() == Level.FINEST) {
        result.setForeground(DARK_GREEN);
      }

      final Object[] parameters = wlr.record.getParameters();
      if (parameters != null) {
        for (final Object parameter : parameters) {
          if (parameter == null) {
            continue;
          }

          if (parameter instanceof Color) {
            result.setForeground((Color) parameter);
          } else if (parameter instanceof Font) {
            result.setFont((Font) parameter);
          }
        }
      }

      return result;
    }
  private void initDebugTextPane() {
    HTMLEditorKit htmlEditorKit = new HTMLEditorKit();
    HTMLDocument htmlDocument = new HTMLDocument();

    debugTextPane.setEditable(false);
    debugTextPane.setBackground(Color.WHITE);
    debugTextPane.setEditorKit(htmlEditorKit);
    htmlEditorKit.install(debugTextPane);
    debugTextPane.setDocument(htmlDocument);
  }
Пример #15
0
  @Override
  public JComponent layoutDialogContent() {
    final JPanel contentpane = new JPanel(new MigLayout("ins 0,wrap 2", "[fill,grow]"));
    messageArea = new JTextPane();
    messageArea.setBorder(null);
    messageArea.setBackground(null);
    messageArea.setOpaque(false);
    messageArea.setText(message);
    messageArea.setEditable(false);
    messageArea.putClientProperty("Synthetica.opaque", Boolean.FALSE);

    contentpane.add("span 2", messageArea);
    contentpane.add(new JLabel(_AWU.T.PASSWORDDIALOG_PASSWORDCHANGE_OLDPASSWORD()));
    if (BinaryLogic.containsAll(flagMask, Dialog.STYLE_LARGE)) {
      input1 = new JPasswordField();
      input1.addKeyListener(this);
      input1.addMouseListener(this);
      contentpane.add(new JScrollPane(input1), "height 20:60:n,pushy,growy,w 250");
    } else {
      input1 = new JPasswordField();
      input1.setBorder(BorderFactory.createEtchedBorder());
      input1.addKeyListener(this);
      input1.addMouseListener(this);
      contentpane.add(input1, "pushy,growy,w 250");
    }
    contentpane.add(new JLabel(_AWU.T.PASSWORDDIALOG_PASSWORDCHANGE_NEWPASSWORD()));
    if (BinaryLogic.containsAll(flagMask, Dialog.STYLE_LARGE)) {
      input2 = new JPasswordField();
      input2.addKeyListener(this);
      input2.addMouseListener(this);
      contentpane.add(new JScrollPane(input2), "height 20:60:n,pushy,growy,w 250");
    } else {
      input2 = new JPasswordField();
      input2.setBorder(BorderFactory.createEtchedBorder());
      input2.addKeyListener(this);
      input2.addMouseListener(this);
      contentpane.add(input2, "pushy,growy,w 250");
    }
    contentpane.add(new JLabel(_AWU.T.PASSWORDDIALOG_PASSWORDCHANGE_NEWPASSWORD_REPEAT()));
    if (BinaryLogic.containsAll(flagMask, Dialog.STYLE_LARGE)) {
      input3 = new JPasswordField();
      input3.addKeyListener(this);
      input3.addMouseListener(this);
      contentpane.add(new JScrollPane(input3), "height 20:60:n,pushy,growy,w 250");
    } else {
      input3 = new JPasswordField();
      input3.setBorder(BorderFactory.createEtchedBorder());
      input3.addKeyListener(this);
      input3.addMouseListener(this);
      contentpane.add(input3, "pushy,growy,w 250");
    }

    return contentpane;
  }
Пример #16
0
 public CustomPanel() {
   super(new BorderLayout());
   setBorder(BorderFactory.createTitledBorder(""));
   this.data = new ArrayList<String>();
   this.sentence = new JTextPane();
   background = this.getBackground();
   sentence.setBackground(this.getBackground());
   taggedText = new String();
   add(sentence);
   border();
 }
Пример #17
0
 private void initGUI() {
   try {
     BorderLayout thisLayout = new BorderLayout();
     this.setLayout(thisLayout);
     this.setPreferredSize(new java.awt.Dimension(691, 416));
     {
       tiltePnl = new JPanel();
       BorderLayout tiltePnlLayout = new BorderLayout();
       tiltePnl.setLayout(tiltePnlLayout);
       this.add(tiltePnl, BorderLayout.NORTH);
       tiltePnl.setPreferredSize(new java.awt.Dimension(691, 51));
       {
         titleTxt = new JTextPane();
         tiltePnl.add(titleTxt, BorderLayout.WEST);
         titleTxt.setText("Welche Art von Event moechten Sie besuchen?");
         titleTxt.setPreferredSize(new java.awt.Dimension(626, 58));
         titleTxt.setBackground(new java.awt.Color(212, 208, 200));
         titleTxt.setEditable(false);
         titleTxt.setOpaque(false);
         titleTxt.setFont(new java.awt.Font("Segoe UI", 0, 18));
       }
     }
     {
       contentPnl = new JPanel();
       this.add(contentPnl, BorderLayout.CENTER);
       GridBagLayout contentPnlLayout = new GridBagLayout();
       contentPnlLayout.rowWeights = new double[] {0.0, 0.0, 0.1};
       contentPnlLayout.rowHeights = new int[] {20, 300, 7};
       contentPnlLayout.columnWeights = new double[] {0.0, 0.0, 0.0, 0.0, 0.1};
       contentPnlLayout.columnWidths = new int[] {30, 200, 200, 200, 7};
       contentPnl.setLayout(contentPnlLayout);
       contentPnl.setPreferredSize(new java.awt.Dimension(691, 365));
       {
         kindOfEventList = new LikeSelectionList();
         contentPnl.add(
             kindOfEventList,
             new GridBagConstraints(
                 1,
                 1,
                 1,
                 1,
                 0.0,
                 0.0,
                 GridBagConstraints.NORTH,
                 GridBagConstraints.NONE,
                 new Insets(0, 0, 0, 0),
                 0,
                 0));
       }
     }
   } catch (Exception e) {
     e.printStackTrace();
   }
 }
Пример #18
0
  public ConsoleWindow() {
    if (gui) {
      window = new JFrame("Package Tracking Console");
      window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
      window.setSize((int) (screenSize.getWidth() / 4), (int) (screenSize.getHeight() / 1.5));
      window.setLocationRelativeTo(null);
      window.getContentPane().setLayout(new BorderLayout());

      menuBar = new JMenuBar();
      menuBar.add("test", new JLabel("Testing"));
      window.setJMenuBar(menuBar);

      StyleContext sc = new StyleContext();
      document = new DefaultStyledDocument(sc);

      // Styles

      send = sc.addStyle("(Send)", null);
      send.addAttribute(StyleConstants.Foreground, Color.CYAN);

      info = sc.addStyle("(Info)", null);
      info.addAttribute(StyleConstants.Foreground, Color.WHITE);

      warning = sc.addStyle("(Warning)", null);
      warning.addAttribute(StyleConstants.Foreground, Color.YELLOW);

      error = sc.addStyle("(Error)", null);
      error.addAttribute(StyleConstants.Foreground, Color.RED);
      error.addAttribute(StyleConstants.Bold, new Boolean(true));

      textArea = new JTextPane(document);
      textArea.setBackground(new Color(50, 50, 50));
      textArea.setEditable(true);
      textArea.setBorder(null);
      textArea.setForeground(Color.WHITE);

      scrollPane = new JScrollPane(textArea);
      new SmartScroller(scrollPane);

      window.getContentPane().add(scrollPane);

      input = new JTextField();
      input.setBackground(new Color(50, 50, 50));
      input.setForeground(Color.WHITE);
      input.setCaretColor(Color.WHITE);
      input.addActionListener(new test());
      window.getContentPane().add(input, BorderLayout.SOUTH);

      window.setVisible(true);
      info.addAttribute(StyleConstants.Foreground, Color.BLUE);
    }
  }
Пример #19
0
 /**
  * This method initializes jTextPane1
  *
  * @return javax.swing.JTextPane
  */
 private JTextPane getJTextPane1() {
   if (jTextPane1 == null) {
     jTextPane1 = new JTextPane();
     jTextPane1.setEditable(false);
     jTextPane1.setBounds(new Rectangle(591, 302, 253, 167));
     jTextPane1.setFont(new Font("Calibri Light", Font.PLAIN, 24));
     jTextPane1.setBackground(new Color(227, 228, 250));
     jTextPane1.setText(
         "Approach one of our friendly staff with your IC or passport to change your password.");
   }
   return jTextPane1;
 }
Пример #20
0
  public void deactivate() {
    indexNode.deregisterChatListenter(this);

    message.setEnabled(false);
    message.setText("You are no longer connected to this index node.  No chats for you.");
    sendMessage.setEnabled(false);
    avatarTable.setEnabled(false);
    chatLog.setBackground(Color.lightGray);

    // Set status
    active = false;
  }
Пример #21
0
  public Container CreateContentPane() {
    // Create the content-pane-to-be.
    JPanel contentPane = new JPanel(new BorderLayout());
    contentPane.setOpaque(true);

    // the log panel
    log = new JTextPane();
    log.setEditable(false);
    log.setBackground(Color.BLACK);
    logPane = new JScrollPane(log);
    kit = new HTMLEditorKit();
    doc = new HTMLDocument();
    log.setEditorKit(kit);
    log.setDocument(doc);
    DefaultCaret c = (DefaultCaret) log.getCaret();
    c.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);
    ClearLog();

    // the preview panel
    previewPane = new DrawPanel();
    previewPane.setPaperSize(paper_top, paper_bottom, paper_left, paper_right);

    // status bar
    statusBar = new StatusBar();
    Font f = statusBar.getFont();
    statusBar.setFont(f.deriveFont(Font.BOLD, 15));
    Dimension d = statusBar.getMinimumSize();
    d.setSize(d.getWidth(), d.getHeight() + 30);
    statusBar.setMinimumSize(d);

    // layout
    Splitter split = new Splitter(JSplitPane.VERTICAL_SPLIT);
    split.add(previewPane);
    split.add(logPane);
    split.setDividerSize(8);

    contentPane.add(statusBar, BorderLayout.SOUTH);
    contentPane.add(split, BorderLayout.CENTER);

    // open the file
    if (recentFiles[0].length() > 0) {
      OpenFileOnDemand(recentFiles[0]);
    }

    // connect to the last port
    ListSerialPorts();
    if (Arrays.asList(portsDetected).contains(recentPort)) {
      OpenPort(recentPort);
    }

    return contentPane;
  }
Пример #22
0
 /** Create the dialog. */
 public HelpDialog() {
   setBounds(100, 100, 506, 410);
   getContentPane().setLayout(new BorderLayout());
   contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
   getContentPane().add(contentPanel, BorderLayout.CENTER);
   contentPanel.setLayout(null);
   {
     JPanel panel = new JPanel();
     panel.setLayout(null);
     panel.setBorder(new EmptyBorder(5, 5, 5, 5));
     panel.setBounds(10, 41, 469, 297);
     contentPanel.add(panel);
     {
       JTextPane textPane = new JTextPane();
       textPane.setBackground(SystemColor.control);
       textPane.setEditable(false);
       textPane.setText(
           "\u03A4\u03BF \u03C0\u03B1\u03C1\u03CE\u03BD \u03C0\u03C1\u03BF\u03B9\u03CC\u03BD \u03B1\u03C0\u03BF\u03C4\u03B5\u03BB\u03B5\u03B9 \u03BC\u03B9\u03B1 \u03C5\u03C0\u03B7\u03C1\u03B5\u03C3\u03B9\u03B1 \u03BC\u03B5 \u03C3\u03BA\u03BF\u03C0\u03BF \u03C4\u03B7\u03BD \u03BA\u03B1\u03BB\u03C5\u03C8\u03B7 \u03B1\u03BD\u03B1\u03B3\u03BA\u03C9\u03BD \u03C0\u03BF\u03C5 \u03B1\u03C6\u03BF\u03C1\u03BF\u03C5\u03BD \r\n\u03C4\u03B7\u03BD \u03B4\u03B9\u03B1\u03C7\u03B5\u03B9\u03C1\u03B7\u03C3\u03B7 \u03C4\u03BF\u03C5 \u03B1\u03BD\u03B8\u03C1\u03C9\u03C0\u03B9\u03BD\u03BF\u03C5 \u03B4\u03C5\u03BD\u03B1\u03BC\u03B9\u03BA\u03BF\u03C5 \u03BC\u03B5\u03C3\u03B1 \u03C3\u03B5 \u03BC\u03B9\u03B1 \u03B5\u03C4\u03B1\u03B9\u03C1\u03B9\u03B1.\r\n\r\n\u03A0\u03C1\u03BF\u03C3\u03C6\u03B5\u03C1\u03B5\u03C4\u03B1\u03B9 \u03B5\u03BD\u03B1 \u03C0\u03BB\u03B7\u03B8\u03BF\u03C2 \u03B4\u03C5\u03BD\u03B1\u03C4\u03BF\u03C4\u03B7\u03C4\u03C9\u03BD (\u03B1\u03BD\u03B1\u03BB\u03BF\u03B3\u03C9\u03C2 \u03C4\u03B7\u03C2 \u03B8\u03B5\u03C3\u03B7\u03C2 \u03C4\u03BF\u03C5 \u03BA\u03B1\u03B8\u03B5 \u03C5\u03C0\u03B1\u03BB\u03BB\u03B7\u03BB\u03BF\u03C5) \u03BF\u03C0\u03BF\u03C5 \u03C3\u03C5\u03BC\u03C0\u03B5\u03C1\u03B9\u03BB\u03B1\u03BC\u03B2\u03B1\u03BD\u03B5\u03B9 :\r\n\r\n\t\u03A0\u03C1\u03BF\u03C3\u03B8\u03B7\u03BA\u03B7 \u03BD\u03B5\u03BF\u03C5 \u03C5\u03C0\u03B1\u03BB\u03BB\u03B7\u03BB\u03BF\u03C5 \u03C3\u03C4\u03B7\u03BD \u03B5\u03C4\u03B1\u03B9\u03C1\u03B9\u03B1\r\n\t\u0395\u03C0\u03B5\u03BE\u03B5\u03C1\u03B3\u03B1\u03C3\u03B9\u03B1 \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03B9\u03C9\u03BD \u03C5\u03C0\u03B1\u03BB\u03BB\u03B7\u03BB\u03BF\u03C5\r\n\t\u03A0\u03C1\u03BF\u03C3\u03B8\u03B7\u03BA\u03B7 \u03BD\u03B5\u03BF\u03C5 \u03C4\u03BC\u03B7\u03BC\u03B1\u03C4\u03BF\u03C2 \u03C3\u03C4\u03B7\u03BD \u03B5\u03C4\u03B1\u03B9\u03C1\u03B9\u03B1\r\n\t\u03A3\u03C5\u03C3\u03C4\u03B7\u03BC\u03B1 \u03B1\u03BE\u03B9\u03BF\u03BB\u03CC\u03B3\u03B7\u03C3\u03B7\u03C2 \u03C5\u03C0\u03B1\u03BB\u03BB\u03AE\u03BB\u03C9\u03BD\r\n\t\u03BA\u03BB\u03C0.\r\n\r\n\u0393\u03B9\u03B1 \u03C0\u03B5\u03C1\u03B9\u03C3\u03C3\u03CC\u03C4\u03B5\u03C1\u03B5\u03C2 \u03C0\u03BB\u03B7\u03C1\u03BF\u03C6\u03BF\u03C1\u03B9\u03B5\u03C2 \u03C3\u03C7\u03B5\u03C4\u03B9\u03BA\u03B1 \u03BC\u03B5 \u03C4\u03B9\u03C2 \u03B4\u03C5\u03BD\u03B1\u03C4\u03BF\u03C4\u03B7\u03C4\u03B5\u03C2 \u03C4\u03BF\u03C5 \u03C0\u03C1\u03BF\u03B3\u03C1\u03B1\u03BC\u03BC\u03B1\u03C4\u03BF\u03C2 \u03B4\u03B9\u03B1\u03C7\u03B5\u03B9\u03C1\u03B7\u03C3\u03B7\u03C2 \u03C0\u03C1\u03BF\u03C3\u03C9\u03C0\u03B9\u03BA\u03BF\u03C5 \u03BF\u03C0\u03C9\u03C2 \u03B5\u03C0\u03B9\u03C3\u03B7\u03C2 \u03BA\u03B1\u03B9 \u03B3\u03B9\u03B1 \u03B1\u03BD\u03B1\u03BB\u03C5\u03C4\u03B9\u03BA\u03B5\u03C2 \u03BF\u03B4\u03B7\u03B3\u03B9\u03B5\u03C2 \u03C3\u03C7\u03B5\u03C4\u03B9\u03BA\u03B1 \u03BC\u03B5 \u03C4\u03B7\u03BD \u03C7\u03C1\u03B7\u03C3\u03B7 \u03C4\u03BF\u03C5 , \u03B1\u03C0\u03B5\u03C5\u03B8\u03C5\u03BD\u03B8\u03B5\u03B9\u03C4\u03B5 \u03C3\u03C4\u03B7\u03BD \u03BA\u03B1\u03C1\u03C4\u03B5\u03BB\u03B1 \"\u039F\u03B4\u03B7\u03B3\u03AF\u03B5\u03C2 \u03A7\u03C1\u03AE\u03C3\u03B7\u03C2\".");
       textPane.setBounds(0, 21, 459, 290);
       panel.add(textPane);
     }
   }
   {
     JLabel label =
         new JLabel(
             "\u03A0\u0395\u03A1\u0399\u0395\u03A7\u039F\u039C\u0395\u039D\u0391 \u0392\u039F\u0397\u0398\u0395\u0399\u0391\u03A3");
     label.setBounds(10, 11, 469, 32);
     contentPanel.add(label);
     label.setHorizontalAlignment(SwingConstants.CENTER);
     label.setFont(new Font("Tahoma", Font.PLAIN, 16));
   }
   {
     JPanel buttonPane = new JPanel();
     buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
     getContentPane().add(buttonPane, BorderLayout.SOUTH);
     {
       JButton cancelButton = new JButton("\u039A\u03BB\u03B5\u03AF\u03C3\u03B9\u03BC\u03BF");
       cancelButton.setIcon(
           new ImageIcon(HelpDialog.class.getResource("/Pictures/error_button.png")));
       cancelButton.addActionListener(
           new ActionListener() {
             public void actionPerformed(ActionEvent e) {
               setVisible(false);
             }
           });
       cancelButton.setActionCommand("Cancel");
       buttonPane.add(cancelButton);
     }
   }
 }
Пример #23
0
  public void reactivate() {
    // Need to re-register incase the index node has been rebooted
    indexNode.registerChatListener(this);

    message.setEnabled(true);
    message.setText("");
    message.requestFocus();
    sendMessage.setEnabled(true);
    avatarTable.setEnabled(true);
    chatLog.setBackground(Color.white);

    // Set status
    active = true;
  }
Пример #24
0
  /**
   * This method is called from within the constructor to initialize the form. WARNING: Do NOT
   * modify this code. The content of this method is always regenerated by the Windows Form
   * Designer. Otherwise, retrieving design might not work properly. Tip: If you must revise this
   * method, please backup this GUI file for JFrameBuilder to retrieve your design properly in
   * future, before revising this method.
   */
  private void initializeComponent() {
    jTextPane1 = new JTextPane();
    jButton1 = new JButton();
    jButton2 = new JButton();
    contentPane = (JPanel) this.getContentPane();

    //
    // jTextPane1
    //
    jTextPane1.setBackground(new Color(140, 152, 236));
    jTextPane1.setForeground(new Color(255, 0, 0));
    jTextPane1.setText(
        "                               \n                                                 NO DONUT FOR YOU\n                           SORRY FOR INCONVINIENCE FACED BY YOU\n                                    SEVER IS DOWN FOR A TIME BEING\n                                         PLEASE TRY AGAIN LATER");
    jTextPane1.setEditable(false);
    //
    // jButton1
    //
    jButton1.setText("Home");
    jButton1.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            jButton1_actionPerformed(e);
          }
        });
    //
    // jButton2
    //
    jButton2.setText("Friends");
    jButton2.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            jButton2_actionPerformed(e);
          }
        });
    //
    // contentPane
    //
    contentPane.setLayout(null);
    contentPane.setBackground(new Color(140, 152, 236));
    addComponent(contentPane, jTextPane1, 76, 165, 451, 150);
    addComponent(contentPane, jButton1, 94, 36, 83, 39);
    addComponent(contentPane, jButton2, 184, 36, 83, 39);
    //
    // serverdown
    //
    this.setTitle("serverdown - extends JFrame");
    this.setLocation(new Point(0, 0));
    this.setSize(new Dimension(1024, 768));
  }
  /** Create the dialog. */
  public ModalMethodDescription(JFrame frame, String mensaje) {

    super(frame, true);

    setTitle("Descripci\u00F3n del m\u00E9todo");
    setIconImage(
        Toolkit.getDefaultToolkit()
            .getImage(
                ModalMethodDescription.class.getResource(
                    "/icons/imagen de respuessta transitoria.jpg")));
    setResizable(false);
    setBounds(100, 100, 600, 500);
    setMinimumSize(new Dimension(600, 500));
    getContentPane().setLayout(new BorderLayout());
    contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
    getContentPane().add(contentPanel, BorderLayout.CENTER);
    contentPanel.setLayout(null);

    JLabel label = new JLabel();
    label.setIcon(
        new ImageIcon(
            ModalMethodDescription.class.getResource(
                "/javax/swing/plaf/metal/icons/ocean/info.png")));
    label.setBounds(10, 10, 32, 43);
    contentPanel.add(label);

    JTextPane textPane = new JTextPane();
    textPane.setText(mensaje);
    JScrollPane scrollPane = new JScrollPane(textPane);
    textPane.setBounds(40, 18, 550, 400);
    scrollPane.setBounds(40, 18, 530, 400);
    textPane.setEditable(false);
    textPane.setFont(new Font("Tahoma", Font.PLAIN, 13));
    textPane.setBackground(SystemColor.control);
    // textPane.setSize(textPane.getPreferredSize());
    contentPanel.add(scrollPane);
    textPane.setCaretPosition(0);

    JButton btnAceptar = new JButton("Aceptar");
    btnAceptar.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            dispose();
          }
        });
    btnAceptar.setBounds(250, 420, 100, 40);
    contentPanel.add(btnAceptar);
  }
Пример #26
0
  public MUStatusComponent(final MUPrefs prefs) {
    super(VERTICAL_SCROLLBAR_ALWAYS, HORIZONTAL_SCROLLBAR_NEVER);

    // Setup our new status pane
    statusPane = new JTextPane();
    statusPane.setBackground(Color.black);
    statusPane.setEditable(false);

    statusPaneWriter = new JTextPaneWriter(statusPane);

    newPreferences(prefs);

    statusPane.setStyledDocument(new BulkStyledDocument(100, mFont));

    setViewportView(statusPane);
  }
  /**
   * @param logs
   * @param firstOrg
   * @param secondOrg
   * @return
   */
  private ProMSplitPane skippedActivityPanelCreator(
      OrganizationalLogs logs, int firstOrg, int secondOrg) {
    ProMSplitPane splitPanelSkippedActivity = new ProMSplitPane();
    splitPanelSkippedActivity.setBackground(null);

    ProMTable comp = null;
    if (firstOrg == secondOrg) {
      comp = skippedActivityTableCreator(logs, firstOrg);
    } else {
      comp = skippedActivityTableCreator(logs, secondOrg);
    }
    if (comp == null) return null;

    JTextPane textField = new JTextPane();
    textField.setContentType("text/html");
    if (firstOrg == secondOrg) {
      textField.setText(
          fontBlack6
              + "Skipped Activities ("
              + comp.getTable().getRowCount()
              + ") </font><hr>"
              + fontBlack4
              + " An activity exists in one process but no equivalent activity is found in the other process. In the list you can see the skipped activities in "
              + logs.organizationNames.get(firstOrg)
              + ".");
    } else {
      textField.setText(
          fontBlack6
              + "Skipped Activities ("
              + comp.getTable().getRowCount()
              + ")</font><hr>"
              + fontBlack4
              + " An activity exists in one process but no equivalent activity is found in the other process. In the list you can see the skipped activities in "
              + logs.organizationNames.get(secondOrg)
              + " compared to "
              + logs.organizationNames.get(firstOrg)
              + ".");
    }
    textField.setEditable(false);
    textField.setBackground(new Color(192, 192, 192));
    JScrollPane scrollPane = new JScrollPane(textField);
    scrollPane.setPreferredSize(new Dimension(500, 0));

    splitPanelSkippedActivity.setLeftComponent(comp);
    splitPanelSkippedActivity.setRightComponent(scrollPane);
    return splitPanelSkippedActivity;
  }
    public EditorDockable(EditorFactory factory, EditorLayout layout) {
      /*
       * it is mandatory to set the factory, the EditorDockable cannot be
       * created without it.
       */
      super(factory);

      /* and then we just set up the editor */
      setTitleText(layout.getFileName());

      // text = new JTextArea();
      text = new JTextPane();
      text.setText(layout.getFileContent());
      text.setBackground(layout.getBackground());
      add(new JScrollPane(text));
      // text.setLineWrap(true);
    }
Пример #29
0
  @Override
  public JComponent layoutDialogContent() {
    final JPanel panel = new JPanel(new MigLayout("ins 5,wrap 1", "[fill,grow]"));

    ImageIcon imageIcon = null;

    if (this.imagefile != null && this.imagefile.exists()) {
      imageIcon = new ImageIcon(this.imagefile.getAbsolutePath());
    } else {
      imageIcon = NewTheme.I().getIcon("ocr", 0);
    }

    final int size =
        SubConfiguration.getConfig("JAC").getIntegerProperty(Configuration.PARAM_CAPTCHA_SIZE, 100);
    if (size != 100) {
      imageIcon =
          new ImageIcon(
              imageIcon
                  .getImage()
                  .getScaledInstance(
                      (int) (imageIcon.getIconWidth() * size / 100.0f),
                      (int) (imageIcon.getIconHeight() * size / 100.0f),
                      Image.SCALE_SMOOTH));
    }

    final JLabel captcha = new JLabel(imageIcon);
    captcha.addMouseListener(this);
    captcha.setCursor(Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));
    captcha.setToolTipText(this.explain);

    if (this.explain != null) {
      final JTextPane tf = new JTextPane();
      tf.setBorder(null);
      tf.setBackground(null);
      tf.setContentType("text/html");
      tf.setOpaque(false);
      tf.putClientProperty("Synthetica.opaque", Boolean.FALSE);
      tf.setText(this.explain);
      tf.setEditable(false);
      panel.add(tf, "");
    }
    panel.add(captcha, "w pref!, h pref!, alignx center");

    return panel;
  }
Пример #30
0
  private void updateFontColor() {
    Font mainFont = DrJava.getConfig().getSetting(OptionConstants.FONT_MAIN);
    Color backColor = DrJava.getConfig().getSetting(OptionConstants.DEFINITIONS_BACKGROUND_COLOR);
    Color fontColor = DrJava.getConfig().getSetting(OptionConstants.DEFINITIONS_NORMAL_COLOR);
    /* make it bigger */
    Font titleFont = mainFont.deriveFont((float) (mainFont.getSize() + 3));
    _antiAliasText = DrJava.getConfig().getSetting(OptionConstants.TEXT_ANTIALIAS).booleanValue();

    _label.setForeground(fontColor);
    _panel.setBackground(backColor);
    _label.setFont(titleFont);
    _textpane.setForeground(fontColor);
    _textpane.setFont(mainFont);
    ;
    _textpane.setBackground(backColor);
    _scroller.setBackground(backColor);
    _scroller.setBorder(new EmptyBorder(0, 0, 0, 0));
    _panel.setBorder(new LineBorder(fontColor, 1));
  }