List of usage examples for javax.swing.text DefaultEditorKit pasteAction
String pasteAction
To view the source code for javax.swing.text DefaultEditorKit pasteAction.
Click Source Link
From source file:edu.harvard.mcz.imagecapture.MainFrame.java
/** * This method initializes jMenuItem2 * /*from w w w .j ava2 s . co m*/ * @return javax.swing.JMenuItem */ private JMenuItem getJMenuItemPaste() { if (jMenuItemPaste == null) { jMenuItemPaste = new JMenuItem(new DefaultEditorKit.PasteAction()); jMenuItemPaste.setText("Paste"); jMenuItemPaste.setMnemonic(KeyEvent.VK_P); jMenuItemPaste.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, ActionEvent.CTRL_MASK)); jMenuItemPaste.setEnabled(true); } return jMenuItemPaste; }
From source file:com.hexidec.ekit.EkitCore.java
/** * Master Constructor/* w w w.ja v a 2 s.co m*/ * * @param sDocument * [String] A text or HTML document to load in the editor upon * startup. * @param sStyleSheet * [String] A CSS stylesheet to load in the editor upon startup. * @param sRawDocument * [String] A document encoded as a String to load in the editor * upon startup. * @param sdocSource * [StyledDocument] Optional document specification, using * javax.swing.text.StyledDocument. * @param urlStyleSheet * [URL] A URL reference to the CSS style sheet. * @param includeToolBar * [boolean] Specifies whether the app should include the * toolbar(s). * @param showViewSource * [boolean] Specifies whether or not to show the View Source * window on startup. * @param showMenuIcons * [boolean] Specifies whether or not to show icon pictures in * menus. * @param sLanguage * [String] The language portion of the Internationalization * Locale to run Ekit in. * @param sCountry * [String] The country portion of the Internationalization * Locale to run Ekit in. * @param base64 * [boolean] Specifies whether the raw document is Base64 encoded * or not. * @param debugMode * [boolean] Specifies whether to show the Debug menu or not. * @param hasSpellChecker * [boolean] Specifies whether or not this uses the SpellChecker * module * @param multiBar * [boolean] Specifies whether to use multiple toolbars or one * big toolbar. * @param toolbarSeq * [String] Code string specifying the toolbar buttons to show. * @param keepUnknownTags * [boolean] Specifies whether or not the parser should retain * unknown tags. * @param enterBreak * [boolean] Specifies whether the ENTER key should insert breaks * instead of paragraph tags. * @param inlineEdit * [boolean] Should edit inline content only (no line breaks) */ public EkitCore(boolean isParentApplet, String sDocument, String sStyleSheet, String sRawDocument, StyledDocument sdocSource, URL urlStyleSheet, boolean includeToolBar, boolean showViewSource, boolean showMenuIcons, String sLanguage, String sCountry, boolean base64, boolean debugMode, boolean hasSpellChecker, boolean multiBar, String toolbarSeq, boolean keepUnknownTags, boolean enterBreak, boolean inlineEdit, List<HTMLDocumentBehavior> behaviors) { super(); if (behaviors != null) { this.behaviors.addAll(behaviors); } preserveUnknownTags = keepUnknownTags; enterIsBreak = enterBreak; this.inlineEdit = inlineEdit; frameHandler = new Frame(); // Determine if system clipboard is available (SecurityManager version) /* * SecurityManager secManager = System.getSecurityManager(); * if(secManager != null) { try { * secManager.checkSystemClipboardAccess(); sysClipboard = * Toolkit.getDefaultToolkit().getSystemClipboard(); } * catch(SecurityException se) { sysClipboard = null; } } */ // Obtain system clipboard if available try { sysClipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); } catch (Exception ex) { sysClipboard = null; } // Plain text DataFlavor for unformatted paste try { dfPlainText = new DataFlavor("text/plain; class=java.lang.String; charset=Unicode"); // Charsets // usually // available // include // Unicode, // UTF-16, // UTF-8, // & // US-ASCII } catch (ClassNotFoundException cnfe) { // it would be nice to use DataFlavor.plainTextFlavor, but that is // deprecated // this will not work as desired, but it will prevent errors from // being thrown later // alternately, we could flag up here that Unformatted Paste is not // available and adjust the UI accordingly // however, the odds of java.lang.String not being found are pretty // slim one imagines dfPlainText = DataFlavor.stringFlavor; } /* Localize for language */ Locale baseLocale = Locale.getDefault(); if (sLanguage != null && sCountry != null) { baseLocale = new Locale(sLanguage, sCountry); } Translatrix.init("EkitLanguageResources", baseLocale); /* Initialise system-specific control key value */ if (!(GraphicsEnvironment.isHeadless())) { CTRLKEY = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(); } /* Create the editor kit, document, and stylesheet */ jtpMain = new EkitTextPane(); htmlKit = new ExtendedHTMLEditorKit(); htmlDoc = (ExtendedHTMLDocument) (htmlKit.createDefaultDocument()); htmlDoc.putProperty("IgnoreCharsetDirective", Boolean.TRUE); htmlDoc.setPreservesUnknownTags(preserveUnknownTags); styleSheet = htmlDoc.getStyleSheet(); htmlKit.setDefaultCursor(new Cursor(Cursor.TEXT_CURSOR)); jtpMain.setCursor(new Cursor(Cursor.TEXT_CURSOR)); /* Set up the text pane */ jtpMain.setEditorKit(htmlKit); jtpMain.setDocument(htmlDoc); // jtpMain.addMouseMotionListener(new EkitMouseMotionListener()); jtpMain.addFocusListener(this); jtpMain.setMargin(new Insets(4, 4, 4, 4)); jtpMain.addKeyListener(this); // jtpMain.setDragEnabled(true); // this causes an error in older Java // versions /* Create the source text area */ if (sdocSource == null) { jtpSource = new JTextArea(); jtpSource.setText(jtpMain.getText()); } else { jtpSource = new JTextArea(sdocSource); jtpMain.setText(jtpSource.getText()); } jtpSource.setBackground(new Color(212, 212, 212)); jtpSource.setSelectionColor(new Color(255, 192, 192)); jtpSource.setMargin(new Insets(4, 4, 4, 4)); jtpSource.getDocument().addDocumentListener(this); jtpSource.addFocusListener(this); jtpSource.setCursor(new Cursor(Cursor.TEXT_CURSOR)); jtpSource.setColumns(1024); jtpSource.setEditable(false); /* Add CaretListener for tracking caret location events */ jtpMain.addCaretListener(new CaretListener() { public void caretUpdate(CaretEvent ce) { handleCaretPositionChange(ce); } }); // Default text if (!inlineEdit) { setDocumentText("<p></p>"); } /* Set up the undo features */ undoMngr = new UndoManager(); undoAction = new UndoAction(); redoAction = new RedoAction(); jtpMain.getDocument().addUndoableEditListener(new CustomUndoableEditListener()); /* Insert raw document, if exists */ if (sRawDocument != null && sRawDocument.length() > 0) { if (base64) { jtpMain.setText(Base64Codec.decode(sRawDocument)); } else { jtpMain.setText(sRawDocument); } } jtpMain.setCaretPosition(0); jtpMain.getDocument().addDocumentListener(this); /* Import CSS from reference, if exists */ if (urlStyleSheet != null) { try { String currDocText = jtpMain.getText(); htmlDoc = (ExtendedHTMLDocument) (htmlKit.createDefaultDocument()); htmlDoc.putProperty("IgnoreCharsetDirective", Boolean.TRUE); htmlDoc.setPreservesUnknownTags(preserveUnknownTags); styleSheet = htmlDoc.getStyleSheet(); BufferedReader br = new BufferedReader(new InputStreamReader(urlStyleSheet.openStream())); styleSheet.loadRules(br, urlStyleSheet); br.close(); htmlDoc = new ExtendedHTMLDocument(styleSheet); registerDocument(htmlDoc); jtpMain.setText(currDocText); jtpSource.setText(jtpMain.getText()); } catch (Exception e) { log.error(e.getMessage(), e); } } /* Preload the specified HTML document, if exists */ if (sDocument != null) { File defHTML = new File(sDocument); if (defHTML.exists()) { try { openDocument(defHTML); } catch (Exception e) { logException("Exception in preloading HTML document", e); } } } /* Preload the specified CSS document, if exists */ if (sStyleSheet != null) { File defCSS = new File(sStyleSheet); if (defCSS.exists()) { try { openStyleSheet(defCSS); } catch (Exception e) { logException("Exception in preloading CSS stylesheet", e); } } } /* Collect the actions that the JTextPane is naturally aware of */ Hashtable<Object, Action> actions = new Hashtable<Object, Action>(); Action[] actionsArray = jtpMain.getActions(); for (Action a : actionsArray) { actions.put(a.getValue(Action.NAME), a); } /* Create shared actions */ actionFontBold = new StyledEditorKit.BoldAction(); actionFontItalic = new StyledEditorKit.ItalicAction(); actionFontUnderline = new StyledEditorKit.UnderlineAction(); actionFontStrike = new FormatAction(this, Translatrix.getTranslationString("FontStrike"), HTML.Tag.STRIKE); actionFontSuperscript = new FormatAction(this, Translatrix.getTranslationString("FontSuperscript"), HTML.Tag.SUP); actionFontSubscript = new FormatAction(this, Translatrix.getTranslationString("FontSubscript"), HTML.Tag.SUB); actionListUnordered = new ListAutomationAction(this, Translatrix.getTranslationString("ListUnordered"), HTML.Tag.UL); actionListOrdered = new ListAutomationAction(this, Translatrix.getTranslationString("ListOrdered"), HTML.Tag.OL); actionSelectFont = new SetFontFamilyAction(this, "[MENUFONTSELECTOR]"); actionAlignLeft = new AlignmentAction(Translatrix.getTranslationString("AlignLeft"), StyleConstants.ALIGN_LEFT); actionAlignCenter = new AlignmentAction(Translatrix.getTranslationString("AlignCenter"), StyleConstants.ALIGN_CENTER); actionAlignRight = new AlignmentAction(Translatrix.getTranslationString("AlignRight"), StyleConstants.ALIGN_RIGHT); actionAlignJustified = new AlignmentAction(Translatrix.getTranslationString("AlignJustified"), StyleConstants.ALIGN_JUSTIFIED); actionInsertAnchor = new CustomAction(this, Translatrix.getTranslationString("InsertAnchor") + menuDialog, HTML.Tag.A); actionClearFormat = new ClearFormatAction(this); actionSpecialChar = new SpecialCharAction(this); // actionTableButtonMenu Action actionTableInsert = new CommandAction(Translatrix.getTranslationString("InsertTable") + menuDialog, getEkitIcon("TableCreate"), CMD_TABLE_INSERT, this); Action actionTableDelete = new CommandAction(Translatrix.getTranslationString("DeleteTable"), getEkitIcon("TableDelete"), CMD_TABLE_DELETE, this); Action actionTableRow = new CommandAction(Translatrix.getTranslationString("InsertTableRow"), getEkitIcon("InsertRow"), CMD_TABLE_ROW_INSERT, this); Action actionTableRowAfter = new CommandAction(Translatrix.getTranslationString("InsertTableRowAfter"), getEkitIcon("InsertRowAfter"), CMD_TABLE_ROW_INSERT_AFTER, this); Action actionTableCol = new CommandAction(Translatrix.getTranslationString("InsertTableColumn"), getEkitIcon("InsertColumn"), CMD_TABLE_COLUMN_INSERT, this); Action actionTableColAfter = new CommandAction(Translatrix.getTranslationString("InsertTableColumnAfter"), getEkitIcon("InsertColumnAfter"), CMD_TABLE_COLUMN_INSERT_AFTER, this); Action actionTableRowDel = new CommandAction(Translatrix.getTranslationString("DeleteTableRow"), getEkitIcon("DeleteRow"), CMD_TABLE_ROW_DELETE, this); Action actionTableColDel = new CommandAction(Translatrix.getTranslationString("DeleteTableColumn"), getEkitIcon("DeleteColumn"), CMD_TABLE_COLUMN_DELETE, this); Action actionTableColFmt = new CommandAction(Translatrix.getTranslationString("FormatTableColumn"), getEkitIcon("FormatColumn"), CMD_TABLE_COLUMN_FORMAT, this); actionTableButtonMenu = new ButtonMenuAction(Translatrix.getTranslationString("TableMenu"), getEkitIcon("TableMenu"), actionTableInsert, actionTableDelete, null, actionTableRow, actionTableRowAfter, actionTableCol, actionTableColAfter, null, actionTableRowDel, actionTableColDel, null, actionTableColFmt); /* Build the menus */ /* FILE Menu */ jMenuFile = new JMenu(Translatrix.getTranslationString("File")); htMenus.put(KEY_MENU_FILE, jMenuFile); JMenuItem jmiNew = new JMenuItem(Translatrix.getTranslationString("NewDocument")); jmiNew.setActionCommand(CMD_DOC_NEW); jmiNew.addActionListener(this); jmiNew.setAccelerator(KeyStroke.getKeyStroke('N', CTRLKEY, false)); if (showMenuIcons) { jmiNew.setIcon(getEkitIcon("New")); } ; jMenuFile.add(jmiNew); JMenuItem jmiNewStyled = new JMenuItem(Translatrix.getTranslationString("NewStyledDocument")); jmiNewStyled.setActionCommand(CMD_DOC_NEW_STYLED); jmiNewStyled.addActionListener(this); if (showMenuIcons) { jmiNewStyled.setIcon(getEkitIcon("NewStyled")); } ; jMenuFile.add(jmiNewStyled); JMenuItem jmiOpenHTML = new JMenuItem(Translatrix.getTranslationString("OpenDocument") + menuDialog); jmiOpenHTML.setActionCommand(CMD_DOC_OPEN_HTML); jmiOpenHTML.addActionListener(this); jmiOpenHTML.setAccelerator(KeyStroke.getKeyStroke('O', CTRLKEY, false)); if (showMenuIcons) { jmiOpenHTML.setIcon(getEkitIcon("Open")); } ; jMenuFile.add(jmiOpenHTML); JMenuItem jmiOpenCSS = new JMenuItem(Translatrix.getTranslationString("OpenStyle") + menuDialog); jmiOpenCSS.setActionCommand(CMD_DOC_OPEN_CSS); jmiOpenCSS.addActionListener(this); jMenuFile.add(jmiOpenCSS); jMenuFile.addSeparator(); JMenuItem jmiSave = new JMenuItem(Translatrix.getTranslationString("Save")); jmiSave.setActionCommand(CMD_DOC_SAVE); jmiSave.addActionListener(this); jmiSave.setAccelerator(KeyStroke.getKeyStroke('S', CTRLKEY, false)); if (showMenuIcons) { jmiSave.setIcon(getEkitIcon("Save")); } ; jMenuFile.add(jmiSave); JMenuItem jmiSaveAs = new JMenuItem(Translatrix.getTranslationString("SaveAs") + menuDialog); jmiSaveAs.setActionCommand(CMD_DOC_SAVE_AS); jmiSaveAs.addActionListener(this); jMenuFile.add(jmiSaveAs); JMenuItem jmiSaveBody = new JMenuItem(Translatrix.getTranslationString("SaveBody") + menuDialog); jmiSaveBody.setActionCommand(CMD_DOC_SAVE_BODY); jmiSaveBody.addActionListener(this); jMenuFile.add(jmiSaveBody); JMenuItem jmiSaveRTF = new JMenuItem(Translatrix.getTranslationString("SaveRTF") + menuDialog); jmiSaveRTF.setActionCommand(CMD_DOC_SAVE_RTF); jmiSaveRTF.addActionListener(this); jMenuFile.add(jmiSaveRTF); jMenuFile.addSeparator(); JMenuItem jmiPrint = new JMenuItem(Translatrix.getTranslationString("Print")); jmiPrint.setActionCommand(CMD_DOC_PRINT); jmiPrint.addActionListener(this); jMenuFile.add(jmiPrint); jMenuFile.addSeparator(); JMenuItem jmiSerialOut = new JMenuItem(Translatrix.getTranslationString("Serialize") + menuDialog); jmiSerialOut.setActionCommand(CMD_DOC_SERIALIZE_OUT); jmiSerialOut.addActionListener(this); jMenuFile.add(jmiSerialOut); JMenuItem jmiSerialIn = new JMenuItem(Translatrix.getTranslationString("ReadFromSer") + menuDialog); jmiSerialIn.setActionCommand(CMD_DOC_SERIALIZE_IN); jmiSerialIn.addActionListener(this); jMenuFile.add(jmiSerialIn); jMenuFile.addSeparator(); JMenuItem jmiExit = new JMenuItem(Translatrix.getTranslationString("Exit")); jmiExit.setActionCommand(CMD_EXIT); jmiExit.addActionListener(this); jMenuFile.add(jmiExit); /* EDIT Menu */ jMenuEdit = new JMenu(Translatrix.getTranslationString("Edit")); htMenus.put(KEY_MENU_EDIT, jMenuEdit); if (sysClipboard != null) { // System Clipboard versions of menu commands JMenuItem jmiCut = new JMenuItem(Translatrix.getTranslationString("Cut")); jmiCut.setActionCommand(CMD_CLIP_CUT); jmiCut.addActionListener(this); jmiCut.setAccelerator(KeyStroke.getKeyStroke('X', CTRLKEY, false)); if (showMenuIcons) { jmiCut.setIcon(getEkitIcon("Cut")); } jMenuEdit.add(jmiCut); JMenuItem jmiCopy = new JMenuItem(Translatrix.getTranslationString("Copy")); jmiCopy.setActionCommand(CMD_CLIP_COPY); jmiCopy.addActionListener(this); jmiCopy.setAccelerator(KeyStroke.getKeyStroke('C', CTRLKEY, false)); if (showMenuIcons) { jmiCopy.setIcon(getEkitIcon("Copy")); } jMenuEdit.add(jmiCopy); JMenuItem jmiPaste = new JMenuItem(Translatrix.getTranslationString("Paste")); jmiPaste.setActionCommand(CMD_CLIP_PASTE); jmiPaste.addActionListener(this); jmiPaste.setAccelerator(KeyStroke.getKeyStroke('V', CTRLKEY, false)); if (showMenuIcons) { jmiPaste.setIcon(getEkitIcon("Paste")); } jMenuEdit.add(jmiPaste); JMenuItem jmiPasteX = new JMenuItem(Translatrix.getTranslationString("PasteUnformatted")); jmiPasteX.setActionCommand(CMD_CLIP_PASTE_PLAIN); jmiPasteX.addActionListener(this); jmiPasteX.setAccelerator(KeyStroke.getKeyStroke('V', CTRLKEY + KeyEvent.SHIFT_MASK, false)); if (showMenuIcons) { jmiPasteX.setIcon(getEkitIcon("PasteUnformatted")); } jMenuEdit.add(jmiPasteX); } else { // DefaultEditorKit versions of menu commands JMenuItem jmiCut = new JMenuItem(new DefaultEditorKit.CutAction()); jmiCut.setText(Translatrix.getTranslationString("Cut")); jmiCut.setAccelerator(KeyStroke.getKeyStroke('X', CTRLKEY, false)); if (showMenuIcons) { jmiCut.setIcon(getEkitIcon("Cut")); } jMenuEdit.add(jmiCut); JMenuItem jmiCopy = new JMenuItem(new DefaultEditorKit.CopyAction()); jmiCopy.setText(Translatrix.getTranslationString("Copy")); jmiCopy.setAccelerator(KeyStroke.getKeyStroke('C', CTRLKEY, false)); if (showMenuIcons) { jmiCopy.setIcon(getEkitIcon("Copy")); } jMenuEdit.add(jmiCopy); JMenuItem jmiPaste = new JMenuItem(new DefaultEditorKit.PasteAction()); jmiPaste.setText(Translatrix.getTranslationString("Paste")); jmiPaste.setAccelerator(KeyStroke.getKeyStroke('V', CTRLKEY, false)); if (showMenuIcons) { jmiPaste.setIcon(getEkitIcon("Paste")); } jMenuEdit.add(jmiPaste); JMenuItem jmiPasteX = new JMenuItem(Translatrix.getTranslationString("PasteUnformatted")); jmiPasteX.setActionCommand(CMD_CLIP_PASTE_PLAIN); jmiPasteX.addActionListener(this); jmiPasteX.setAccelerator(KeyStroke.getKeyStroke('V', CTRLKEY + KeyEvent.SHIFT_MASK, false)); if (showMenuIcons) { jmiPasteX.setIcon(getEkitIcon("PasteUnformatted")); } jMenuEdit.add(jmiPasteX); } jMenuEdit.addSeparator(); JMenuItem jmiUndo = new JMenuItem(undoAction); jmiUndo.setAccelerator(KeyStroke.getKeyStroke('Z', CTRLKEY, false)); if (showMenuIcons) { jmiUndo.setIcon(getEkitIcon("Undo")); } jMenuEdit.add(jmiUndo); JMenuItem jmiRedo = new JMenuItem(redoAction); jmiRedo.setAccelerator(KeyStroke.getKeyStroke('Y', CTRLKEY, false)); if (showMenuIcons) { jmiRedo.setIcon(getEkitIcon("Redo")); } jMenuEdit.add(jmiRedo); jMenuEdit.addSeparator(); JMenuItem jmiSelAll = new JMenuItem((Action) actions.get(DefaultEditorKit.selectAllAction)); jmiSelAll.setText(Translatrix.getTranslationString("SelectAll")); jmiSelAll.setAccelerator(KeyStroke.getKeyStroke('A', CTRLKEY, false)); jMenuEdit.add(jmiSelAll); JMenuItem jmiSelPara = new JMenuItem((Action) actions.get(DefaultEditorKit.selectParagraphAction)); jmiSelPara.setText(Translatrix.getTranslationString("SelectParagraph")); jMenuEdit.add(jmiSelPara); JMenuItem jmiSelLine = new JMenuItem((Action) actions.get(DefaultEditorKit.selectLineAction)); jmiSelLine.setText(Translatrix.getTranslationString("SelectLine")); jMenuEdit.add(jmiSelLine); JMenuItem jmiSelWord = new JMenuItem((Action) actions.get(DefaultEditorKit.selectWordAction)); jmiSelWord.setText(Translatrix.getTranslationString("SelectWord")); jMenuEdit.add(jmiSelWord); jMenuEdit.addSeparator(); JMenu jMenuEnterKey = new JMenu(Translatrix.getTranslationString("EnterKeyMenu")); jcbmiEnterKeyParag = new JCheckBoxMenuItem(Translatrix.getTranslationString("EnterKeyParag"), !enterIsBreak); jcbmiEnterKeyParag.setActionCommand(CMD_ENTER_PARAGRAPH); jcbmiEnterKeyParag.addActionListener(this); jMenuEnterKey.add(jcbmiEnterKeyParag); jcbmiEnterKeyBreak = new JCheckBoxMenuItem(Translatrix.getTranslationString("EnterKeyBreak"), enterIsBreak); jcbmiEnterKeyBreak.setActionCommand(CMD_ENTER_BREAK); jcbmiEnterKeyBreak.addActionListener(this); jMenuEnterKey.add(jcbmiEnterKeyBreak); jMenuEdit.add(jMenuEnterKey); /* VIEW Menu */ jMenuView = new JMenu(Translatrix.getTranslationString("View")); htMenus.put(KEY_MENU_VIEW, jMenuView); if (includeToolBar) { if (multiBar) { jMenuToolbars = new JMenu(Translatrix.getTranslationString("ViewToolbars")); jcbmiViewToolbarMain = new JCheckBoxMenuItem(Translatrix.getTranslationString("ViewToolbarMain"), false); jcbmiViewToolbarMain.setActionCommand(CMD_TOGGLE_TOOLBAR_MAIN); jcbmiViewToolbarMain.addActionListener(this); jMenuToolbars.add(jcbmiViewToolbarMain); jcbmiViewToolbarFormat = new JCheckBoxMenuItem( Translatrix.getTranslationString("ViewToolbarFormat"), false); jcbmiViewToolbarFormat.setActionCommand(CMD_TOGGLE_TOOLBAR_FORMAT); jcbmiViewToolbarFormat.addActionListener(this); jMenuToolbars.add(jcbmiViewToolbarFormat); jcbmiViewToolbarStyles = new JCheckBoxMenuItem( Translatrix.getTranslationString("ViewToolbarStyles"), false); jcbmiViewToolbarStyles.setActionCommand(CMD_TOGGLE_TOOLBAR_STYLES); jcbmiViewToolbarStyles.addActionListener(this); jMenuToolbars.add(jcbmiViewToolbarStyles); jMenuView.add(jMenuToolbars); } else { jcbmiViewToolbar = new JCheckBoxMenuItem(Translatrix.getTranslationString("ViewToolbar"), false); jcbmiViewToolbar.setActionCommand(CMD_TOGGLE_TOOLBAR_SINGLE); jcbmiViewToolbar.addActionListener(this); jMenuView.add(jcbmiViewToolbar); } } jcbmiViewSource = new JCheckBoxMenuItem(Translatrix.getTranslationString("ViewSource"), false); jcbmiViewSource.setActionCommand(CMD_TOGGLE_SOURCE_VIEW); jcbmiViewSource.addActionListener(this); jMenuView.add(jcbmiViewSource); /* FONT Menu */ jMenuFont = new JMenu(Translatrix.getTranslationString("Font")); htMenus.put(KEY_MENU_FONT, jMenuFont); JMenuItem jmiBold = new JMenuItem(actionFontBold); jmiBold.setText(Translatrix.getTranslationString("FontBold")); jmiBold.setAccelerator(KeyStroke.getKeyStroke('B', CTRLKEY, false)); if (showMenuIcons) { jmiBold.setIcon(getEkitIcon("Bold")); } jMenuFont.add(jmiBold); JMenuItem jmiItalic = new JMenuItem(actionFontItalic); jmiItalic.setText(Translatrix.getTranslationString("FontItalic")); jmiItalic.setAccelerator(KeyStroke.getKeyStroke('I', CTRLKEY, false)); if (showMenuIcons) { jmiItalic.setIcon(getEkitIcon("Italic")); } jMenuFont.add(jmiItalic); JMenuItem jmiUnderline = new JMenuItem(actionFontUnderline); jmiUnderline.setText(Translatrix.getTranslationString("FontUnderline")); jmiUnderline.setAccelerator(KeyStroke.getKeyStroke('U', CTRLKEY, false)); if (showMenuIcons) { jmiUnderline.setIcon(getEkitIcon("Underline")); } jMenuFont.add(jmiUnderline); JMenuItem jmiStrike = new JMenuItem(actionFontStrike); jmiStrike.setText(Translatrix.getTranslationString("FontStrike")); if (showMenuIcons) { jmiStrike.setIcon(getEkitIcon("Strike")); } jMenuFont.add(jmiStrike); JMenuItem jmiSupscript = new JMenuItem(actionFontSuperscript); if (showMenuIcons) { jmiSupscript.setIcon(getEkitIcon("Super")); } jMenuFont.add(jmiSupscript); JMenuItem jmiSubscript = new JMenuItem(actionFontSubscript); if (showMenuIcons) { jmiSubscript.setIcon(getEkitIcon("Sub")); } jMenuFont.add(jmiSubscript); jMenuFont.addSeparator(); jMenuFont.add( new JMenuItem(new FormatAction(this, Translatrix.getTranslationString("FormatBig"), HTML.Tag.BIG))); jMenuFont.add(new JMenuItem( new FormatAction(this, Translatrix.getTranslationString("FormatSmall"), HTML.Tag.SMALL))); JMenu jMenuFontSize = new JMenu(Translatrix.getTranslationString("FontSize")); jMenuFontSize.add(new JMenuItem( new StyledEditorKit.FontSizeAction(Translatrix.getTranslationString("FontSize1"), 8))); jMenuFontSize.add(new JMenuItem( new StyledEditorKit.FontSizeAction(Translatrix.getTranslationString("FontSize2"), 10))); jMenuFontSize.add(new JMenuItem( new StyledEditorKit.FontSizeAction(Translatrix.getTranslationString("FontSize3"), 12))); jMenuFontSize.add(new JMenuItem( new StyledEditorKit.FontSizeAction(Translatrix.getTranslationString("FontSize4"), 14))); jMenuFontSize.add(new JMenuItem( new StyledEditorKit.FontSizeAction(Translatrix.getTranslationString("FontSize5"), 18))); jMenuFontSize.add(new JMenuItem( new StyledEditorKit.FontSizeAction(Translatrix.getTranslationString("FontSize6"), 24))); jMenuFontSize.add(new JMenuItem( new StyledEditorKit.FontSizeAction(Translatrix.getTranslationString("FontSize7"), 32))); jMenuFont.add(jMenuFontSize); jMenuFont.addSeparator(); JMenu jMenuFontSub = new JMenu(Translatrix.getTranslationString("Font")); JMenuItem jmiSelectFont = new JMenuItem(actionSelectFont); jmiSelectFont.setText(Translatrix.getTranslationString("FontSelect") + menuDialog); if (showMenuIcons) { jmiSelectFont.setIcon(getEkitIcon("FontFaces")); } jMenuFontSub.add(jmiSelectFont); JMenuItem jmiSerif = new JMenuItem((Action) actions.get("font-family-Serif")); jmiSerif.setText(Translatrix.getTranslationString("FontSerif")); jMenuFontSub.add(jmiSerif); JMenuItem jmiSansSerif = new JMenuItem((Action) actions.get("font-family-SansSerif")); jmiSansSerif.setText(Translatrix.getTranslationString("FontSansserif")); jMenuFontSub.add(jmiSansSerif); JMenuItem jmiMonospaced = new JMenuItem((Action) actions.get("font-family-Monospaced")); jmiMonospaced.setText(Translatrix.getTranslationString("FontMonospaced")); jMenuFontSub.add(jmiMonospaced); jMenuFont.add(jMenuFontSub); jMenuFont.addSeparator(); JMenu jMenuFontColor = new JMenu(Translatrix.getTranslationString("Color")); Hashtable<String, String> customAttr = new Hashtable<String, String>(); customAttr.put("color", "black"); jMenuFontColor.add(new JMenuItem(new CustomAction(this, Translatrix.getTranslationString("CustomColor") + menuDialog, HTML.Tag.FONT, customAttr))); jMenuFontColor.add(new JMenuItem(new StyledEditorKit.ForegroundAction( Translatrix.getTranslationString("ColorAqua"), new Color(0, 255, 255)))); jMenuFontColor.add(new JMenuItem(new StyledEditorKit.ForegroundAction( Translatrix.getTranslationString("ColorBlack"), new Color(0, 0, 0)))); jMenuFontColor.add(new JMenuItem(new StyledEditorKit.ForegroundAction( Translatrix.getTranslationString("ColorBlue"), new Color(0, 0, 255)))); jMenuFontColor.add(new JMenuItem(new StyledEditorKit.ForegroundAction( Translatrix.getTranslationString("ColorFuschia"), new Color(255, 0, 255)))); jMenuFontColor.add(new JMenuItem(new StyledEditorKit.ForegroundAction( Translatrix.getTranslationString("ColorGray"), new Color(128, 128, 128)))); jMenuFontColor.add(new JMenuItem(new StyledEditorKit.ForegroundAction( Translatrix.getTranslationString("ColorGreen"), new Color(0, 128, 0)))); jMenuFontColor.add(new JMenuItem(new StyledEditorKit.ForegroundAction( Translatrix.getTranslationString("ColorLime"), new Color(0, 255, 0)))); jMenuFontColor.add(new JMenuItem(new StyledEditorKit.ForegroundAction( Translatrix.getTranslationString("ColorMaroon"), new Color(128, 0, 0)))); jMenuFontColor.add(new JMenuItem(new StyledEditorKit.ForegroundAction( Translatrix.getTranslationString("ColorNavy"), new Color(0, 0, 128)))); jMenuFontColor.add(new JMenuItem(new StyledEditorKit.ForegroundAction( Translatrix.getTranslationString("ColorOlive"), new Color(128, 128, 0)))); jMenuFontColor.add(new JMenuItem(new StyledEditorKit.ForegroundAction( Translatrix.getTranslationString("ColorPurple"), new Color(128, 0, 128)))); jMenuFontColor.add(new JMenuItem(new StyledEditorKit.ForegroundAction( Translatrix.getTranslationString("ColorRed"), new Color(255, 0, 0)))); jMenuFontColor.add(new JMenuItem(new StyledEditorKit.ForegroundAction( Translatrix.getTranslationString("ColorSilver"), new Color(192, 192, 192)))); jMenuFontColor.add(new JMenuItem(new StyledEditorKit.ForegroundAction( Translatrix.getTranslationString("ColorTeal"), new Color(0, 128, 128)))); jMenuFontColor.add(new JMenuItem(new StyledEditorKit.ForegroundAction( Translatrix.getTranslationString("ColorWhite"), new Color(255, 255, 255)))); jMenuFontColor.add(new JMenuItem(new StyledEditorKit.ForegroundAction( Translatrix.getTranslationString("ColorYellow"), new Color(255, 255, 0)))); jMenuFont.add(jMenuFontColor); /* FORMAT Menu */ jMenuFormat = new JMenu(Translatrix.getTranslationString("Format")); htMenus.put(KEY_MENU_FORMAT, jMenuFormat); JMenuItem jmiClearFormat = new JMenuItem(actionClearFormat); jMenuFormat.add(jmiClearFormat); jMenuFormat.addSeparator(); JMenu jMenuFormatAlign = new JMenu(Translatrix.getTranslationString("Align")); JMenuItem jmiAlignLeft = new JMenuItem(actionAlignLeft); if (showMenuIcons) { jmiAlignLeft.setIcon(getEkitIcon("AlignLeft")); } ; jMenuFormatAlign.add(jmiAlignLeft); JMenuItem jmiAlignCenter = new JMenuItem(actionAlignCenter); if (showMenuIcons) { jmiAlignCenter.setIcon(getEkitIcon("AlignCenter")); } ; jMenuFormatAlign.add(jmiAlignCenter); JMenuItem jmiAlignRight = new JMenuItem(actionAlignRight); if (showMenuIcons) { jmiAlignRight.setIcon(getEkitIcon("AlignRight")); } ; jMenuFormatAlign.add(jmiAlignRight); JMenuItem jmiAlignJustified = new JMenuItem(actionAlignJustified); if (showMenuIcons) { jmiAlignJustified.setIcon(getEkitIcon("AlignJustified")); } ; jMenuFormatAlign.add(jmiAlignJustified); jMenuFormat.add(jMenuFormatAlign); jMenuFormat.addSeparator(); JMenu jMenuFormatHeading = new JMenu(Translatrix.getTranslationString("Heading")); jMenuFormatHeading.add( new JMenuItem(new FormatAction(this, Translatrix.getTranslationString("Heading1"), HTML.Tag.H1))); jMenuFormatHeading.add( new JMenuItem(new FormatAction(this, Translatrix.getTranslationString("Heading2"), HTML.Tag.H2))); jMenuFormatHeading.add( new JMenuItem(new FormatAction(this, Translatrix.getTranslationString("Heading3"), HTML.Tag.H3))); jMenuFormatHeading.add( new JMenuItem(new FormatAction(this, Translatrix.getTranslationString("Heading4"), HTML.Tag.H4))); jMenuFormatHeading.add( new JMenuItem(new FormatAction(this, Translatrix.getTranslationString("Heading5"), HTML.Tag.H5))); jMenuFormatHeading.add( new JMenuItem(new FormatAction(this, Translatrix.getTranslationString("Heading6"), HTML.Tag.H6))); jMenuFormat.add(jMenuFormatHeading); jMenuFormat.addSeparator(); JMenuItem jmiUList = new JMenuItem(actionListUnordered); if (showMenuIcons) { jmiUList.setIcon(getEkitIcon("UList")); } jMenuFormat.add(jmiUList); JMenuItem jmiOList = new JMenuItem(actionListOrdered); if (showMenuIcons) { jmiOList.setIcon(getEkitIcon("OList")); } jMenuFormat.add(jmiOList); jMenuFormat.add( new JMenuItem(new FormatAction(this, Translatrix.getTranslationString("ListItem"), HTML.Tag.LI))); jMenuFormat.addSeparator(); jMenuFormat.add(new JMenuItem( new FormatAction(this, Translatrix.getTranslationString("FormatBlockquote"), HTML.Tag.BLOCKQUOTE))); jMenuFormat.add( new JMenuItem(new FormatAction(this, Translatrix.getTranslationString("FormatPre"), HTML.Tag.PRE))); jMenuFormat.add(new JMenuItem( new FormatAction(this, Translatrix.getTranslationString("FormatStrong"), HTML.Tag.STRONG))); jMenuFormat.add(new JMenuItem( new FormatAction(this, Translatrix.getTranslationString("FormatEmphasis"), HTML.Tag.EM))); jMenuFormat.add( new JMenuItem(new FormatAction(this, Translatrix.getTranslationString("FormatTT"), HTML.Tag.TT))); jMenuFormat.add(new JMenuItem( new FormatAction(this, Translatrix.getTranslationString("FormatSpan"), HTML.Tag.SPAN))); /* INSERT Menu */ jMenuInsert = new JMenu(Translatrix.getTranslationString("Insert")); htMenus.put(KEY_MENU_INSERT, jMenuInsert); JMenuItem jmiInsertAnchor = new JMenuItem(actionInsertAnchor); if (showMenuIcons) { jmiInsertAnchor.setIcon(getEkitIcon("Anchor")); } ; jMenuInsert.add(jmiInsertAnchor); JMenuItem jmiBreak = new JMenuItem(Translatrix.getTranslationString("InsertBreak")); jmiBreak.setActionCommand(CMD_INSERT_BREAK); jmiBreak.addActionListener(this); jmiBreak.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, KeyEvent.SHIFT_MASK, false)); jMenuInsert.add(jmiBreak); JMenuItem jmiNBSP = new JMenuItem(Translatrix.getTranslationString("InsertNBSP")); jmiNBSP.setActionCommand(CMD_INSERT_NBSP); jmiNBSP.addActionListener(this); jmiNBSP.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, KeyEvent.SHIFT_MASK, false)); jMenuInsert.add(jmiNBSP); JMenu jMenuUnicode = new JMenu(Translatrix.getTranslationString("InsertUnicodeCharacter")); if (showMenuIcons) { jMenuUnicode.setIcon(getEkitIcon("Unicode")); } ; JMenuItem jmiUnicodeAll = new JMenuItem( Translatrix.getTranslationString("InsertUnicodeCharacterAll") + menuDialog); if (showMenuIcons) { jmiUnicodeAll.setIcon(getEkitIcon("Unicode")); } ; jmiUnicodeAll.setActionCommand(CMD_INSERT_UNICODE_CHAR); jmiUnicodeAll.addActionListener(this); jMenuUnicode.add(jmiUnicodeAll); JMenuItem jmiUnicodeMath = new JMenuItem( Translatrix.getTranslationString("InsertUnicodeCharacterMath") + menuDialog); if (showMenuIcons) { jmiUnicodeMath.setIcon(getEkitIcon("Math")); } ; jmiUnicodeMath.setActionCommand(CMD_INSERT_UNICODE_MATH); jmiUnicodeMath.addActionListener(this); jMenuUnicode.add(jmiUnicodeMath); JMenuItem jmiUnicodeDraw = new JMenuItem( Translatrix.getTranslationString("InsertUnicodeCharacterDraw") + menuDialog); if (showMenuIcons) { jmiUnicodeDraw.setIcon(getEkitIcon("Draw")); } ; jmiUnicodeDraw.setActionCommand(CMD_INSERT_UNICODE_DRAW); jmiUnicodeDraw.addActionListener(this); jMenuUnicode.add(jmiUnicodeDraw); JMenuItem jmiUnicodeDing = new JMenuItem( Translatrix.getTranslationString("InsertUnicodeCharacterDing") + menuDialog); jmiUnicodeDing.setActionCommand(CMD_INSERT_UNICODE_DING); jmiUnicodeDing.addActionListener(this); jMenuUnicode.add(jmiUnicodeDing); JMenuItem jmiUnicodeSigs = new JMenuItem( Translatrix.getTranslationString("InsertUnicodeCharacterSigs") + menuDialog); jmiUnicodeSigs.setActionCommand(CMD_INSERT_UNICODE_SIGS); jmiUnicodeSigs.addActionListener(this); jMenuUnicode.add(jmiUnicodeSigs); JMenuItem jmiUnicodeSpec = new JMenuItem( Translatrix.getTranslationString("InsertUnicodeCharacterSpec") + menuDialog); jmiUnicodeSpec.setActionCommand(CMD_INSERT_UNICODE_SPEC); jmiUnicodeSpec.addActionListener(this); jMenuUnicode.add(jmiUnicodeSpec); jMenuInsert.add(jMenuUnicode); JMenuItem jmiHRule = new JMenuItem(Translatrix.getTranslationString("InsertHorizontalRule")); jmiHRule.setActionCommand(CMD_INSERT_HR); jmiHRule.addActionListener(this); jMenuInsert.add(jmiHRule); jMenuInsert.addSeparator(); if (!isParentApplet) { JMenuItem jmiImageLocal = new JMenuItem( Translatrix.getTranslationString("InsertLocalImage") + menuDialog); jmiImageLocal.setActionCommand(CMD_INSERT_IMAGE_LOCAL); jmiImageLocal.addActionListener(this); jMenuInsert.add(jmiImageLocal); } JMenuItem jmiImageURL = new JMenuItem(Translatrix.getTranslationString("InsertURLImage") + menuDialog); jmiImageURL.setActionCommand(CMD_INSERT_IMAGE_URL); jmiImageURL.addActionListener(this); jMenuInsert.add(jmiImageURL); /* TABLE Menu */ jMenuTable = new JMenu(Translatrix.getTranslationString("Table")); htMenus.put(KEY_MENU_TABLE, jMenuTable); JMenuItem jmiTable = new JMenuItem(actionTableInsert); if (!showMenuIcons) { jmiTable.setIcon(null); } jMenuTable.add(jmiTable); jMenuTable.addSeparator(); Action actionTableEdit = new CommandAction(Translatrix.getTranslationString("TableEdit") + menuDialog, getEkitIcon("TableEdit"), CMD_TABLE_EDIT, this); JMenuItem jmiEditTable = new JMenuItem(actionTableEdit); if (!showMenuIcons) { jmiEditTable.setIcon(null); } jMenuTable.add(jmiEditTable); Action actionCellEdit = new CommandAction(Translatrix.getTranslationString("TableCellEdit") + menuDialog, getEkitIcon("CellEdit"), CMD_TABLE_CELL_EDIT, this); JMenuItem jmiEditCell = new JMenuItem(actionCellEdit); if (!showMenuIcons) { jmiEditCell.setIcon(null); } jmiEditCell.setActionCommand(CMD_TABLE_CELL_EDIT); jmiEditCell.addActionListener(this); jMenuTable.add(jmiEditCell); jMenuTable.addSeparator(); JMenuItem jmiTableRow = new JMenuItem(actionTableRow); if (!showMenuIcons) { jmiTableRow.setIcon(null); } jMenuTable.add(jmiTableRow); JMenuItem jmiTableCol = new JMenuItem(actionTableCol); if (!showMenuIcons) { jmiTableCol.setIcon(null); } jMenuTable.add(jmiTableCol); jMenuTable.addSeparator(); JMenuItem jmiTableRowDel = new JMenuItem(actionTableRowDel); if (!showMenuIcons) { jmiTableRowDel.setIcon(null); } jMenuTable.add(jmiTableRowDel); JMenuItem jmiTableColDel = new JMenuItem(actionTableColDel); if (!showMenuIcons) { jmiTableColDel.setIcon(null); } jMenuTable.add(jmiTableColDel); /* FORMS Menu */ jMenuForms = new JMenu(Translatrix.getTranslationString("Forms")); htMenus.put(KEY_MENU_FORMS, jMenuForms); JMenuItem jmiFormInsertForm = new JMenuItem(Translatrix.getTranslationString("FormInsertForm")); jmiFormInsertForm.setActionCommand(CMD_FORM_INSERT); jmiFormInsertForm.addActionListener(this); jMenuForms.add(jmiFormInsertForm); jMenuForms.addSeparator(); JMenuItem jmiFormTextfield = new JMenuItem(Translatrix.getTranslationString("FormTextfield")); jmiFormTextfield.setActionCommand(CMD_FORM_TEXTFIELD); jmiFormTextfield.addActionListener(this); jMenuForms.add(jmiFormTextfield); JMenuItem jmiFormTextarea = new JMenuItem(Translatrix.getTranslationString("FormTextarea")); jmiFormTextarea.setActionCommand(CMD_FORM_TEXTAREA); jmiFormTextarea.addActionListener(this); jMenuForms.add(jmiFormTextarea); JMenuItem jmiFormCheckbox = new JMenuItem(Translatrix.getTranslationString("FormCheckbox")); jmiFormCheckbox.setActionCommand(CMD_FORM_CHECKBOX); jmiFormCheckbox.addActionListener(this); jMenuForms.add(jmiFormCheckbox); JMenuItem jmiFormRadio = new JMenuItem(Translatrix.getTranslationString("FormRadio")); jmiFormRadio.setActionCommand(CMD_FORM_RADIO); jmiFormRadio.addActionListener(this); jMenuForms.add(jmiFormRadio); JMenuItem jmiFormPassword = new JMenuItem(Translatrix.getTranslationString("FormPassword")); jmiFormPassword.setActionCommand(CMD_FORM_PASSWORD); jmiFormPassword.addActionListener(this); jMenuForms.add(jmiFormPassword); jMenuForms.addSeparator(); JMenuItem jmiFormButton = new JMenuItem(Translatrix.getTranslationString("FormButton")); jmiFormButton.setActionCommand(CMD_FORM_BUTTON); jmiFormButton.addActionListener(this); jMenuForms.add(jmiFormButton); JMenuItem jmiFormButtonSubmit = new JMenuItem(Translatrix.getTranslationString("FormButtonSubmit")); jmiFormButtonSubmit.setActionCommand(CMD_FORM_SUBMIT); jmiFormButtonSubmit.addActionListener(this); jMenuForms.add(jmiFormButtonSubmit); JMenuItem jmiFormButtonReset = new JMenuItem(Translatrix.getTranslationString("FormButtonReset")); jmiFormButtonReset.setActionCommand(CMD_FORM_RESET); jmiFormButtonReset.addActionListener(this); jMenuForms.add(jmiFormButtonReset); /* TOOLS Menu */ if (hasSpellChecker) { jMenuTools = new JMenu(Translatrix.getTranslationString("Tools")); htMenus.put(KEY_MENU_TOOLS, jMenuTools); JMenuItem jmiSpellcheck = new JMenuItem(Translatrix.getTranslationString("ToolSpellcheck")); jmiSpellcheck.setActionCommand(CMD_SPELLCHECK); jmiSpellcheck.addActionListener(this); jMenuTools.add(jmiSpellcheck); } /* SEARCH Menu */ jMenuSearch = new JMenu(Translatrix.getTranslationString("Search")); htMenus.put(KEY_MENU_SEARCH, jMenuSearch); JMenuItem jmiFind = new JMenuItem(Translatrix.getTranslationString("SearchFind")); if (showMenuIcons) { jmiFind.setIcon(getEkitIcon("Find")); } ; jmiFind.setActionCommand(CMD_SEARCH_FIND); jmiFind.addActionListener(this); jmiFind.setAccelerator(KeyStroke.getKeyStroke('F', CTRLKEY, false)); jMenuSearch.add(jmiFind); JMenuItem jmiFindAgain = new JMenuItem(Translatrix.getTranslationString("SearchFindAgain")); if (showMenuIcons) { jmiFindAgain.setIcon(getEkitIcon("FindAgain")); } ; jmiFindAgain.setActionCommand(CMD_SEARCH_FIND_AGAIN); jmiFindAgain.addActionListener(this); jmiFindAgain.setAccelerator(KeyStroke.getKeyStroke('G', CTRLKEY, false)); jMenuSearch.add(jmiFindAgain); JMenuItem jmiReplace = new JMenuItem(Translatrix.getTranslationString("SearchReplace")); if (showMenuIcons) { jmiReplace.setIcon(getEkitIcon("Replace")); } ; jmiReplace.setActionCommand(CMD_SEARCH_REPLACE); jmiReplace.addActionListener(this); jmiReplace.setAccelerator(KeyStroke.getKeyStroke('R', CTRLKEY, false)); jMenuSearch.add(jmiReplace); /* HELP Menu */ jMenuHelp = new JMenu(Translatrix.getTranslationString("Help")); htMenus.put(KEY_MENU_HELP, jMenuHelp); JMenuItem jmiAbout = new JMenuItem(Translatrix.getTranslationString("About")); jmiAbout.setActionCommand(CMD_HELP_ABOUT); jmiAbout.addActionListener(this); jMenuHelp.add(jmiAbout); /* DEBUG Menu */ jMenuDebug = new JMenu(Translatrix.getTranslationString("Debug")); htMenus.put(KEY_MENU_DEBUG, jMenuDebug); JMenuItem jmiDesc = new JMenuItem(Translatrix.getTranslationString("DescribeDoc")); jmiDesc.setActionCommand(CMD_DEBUG_DESCRIBE_DOC); jmiDesc.addActionListener(this); jMenuDebug.add(jmiDesc); JMenuItem jmiDescCSS = new JMenuItem(Translatrix.getTranslationString("DescribeCSS")); jmiDescCSS.setActionCommand(CMD_DEBUG_DESCRIBE_CSS); jmiDescCSS.addActionListener(this); jMenuDebug.add(jmiDescCSS); JMenuItem jmiTag = new JMenuItem(Translatrix.getTranslationString("WhatTags")); jmiTag.setActionCommand(CMD_DEBUG_CURRENT_TAGS); jmiTag.addActionListener(this); jMenuDebug.add(jmiTag); /* Create menubar and add menus */ jMenuBar = new JMenuBar(); jMenuBar.add(jMenuFile); jMenuBar.add(jMenuEdit); jMenuBar.add(jMenuView); jMenuBar.add(jMenuFont); jMenuBar.add(jMenuFormat); jMenuBar.add(jMenuSearch); jMenuBar.add(jMenuInsert); jMenuBar.add(jMenuTable); jMenuBar.add(jMenuForms); if (jMenuTools != null) { jMenuBar.add(jMenuTools); } jMenuBar.add(jMenuHelp); if (debugMode) { jMenuBar.add(jMenuDebug); } /* Create toolbar tool objects */ jbtnNewHTML = new JButtonNoFocus(getEkitIcon("New")); jbtnNewHTML.setToolTipText(Translatrix.getTranslationString("NewDocument")); jbtnNewHTML.setActionCommand(CMD_DOC_NEW); jbtnNewHTML.addActionListener(this); htTools.put(KEY_TOOL_NEW, jbtnNewHTML); jbtnNewStyledHTML = new JButtonNoFocus(getEkitIcon("NewStyled")); jbtnNewStyledHTML.setToolTipText(Translatrix.getTranslationString("NewStyledDocument")); jbtnNewStyledHTML.setActionCommand(CMD_DOC_NEW_STYLED); jbtnNewStyledHTML.addActionListener(this); htTools.put(KEY_TOOL_NEWSTYLED, jbtnNewStyledHTML); jbtnOpenHTML = new JButtonNoFocus(getEkitIcon("Open")); jbtnOpenHTML.setToolTipText(Translatrix.getTranslationString("OpenDocument")); jbtnOpenHTML.setActionCommand(CMD_DOC_OPEN_HTML); jbtnOpenHTML.addActionListener(this); htTools.put(KEY_TOOL_OPEN, jbtnOpenHTML); jbtnSaveHTML = new JButtonNoFocus(getEkitIcon("Save")); jbtnSaveHTML.setToolTipText(Translatrix.getTranslationString("SaveDocument")); jbtnSaveHTML.setActionCommand(CMD_DOC_SAVE_AS); jbtnSaveHTML.addActionListener(this); htTools.put(KEY_TOOL_SAVE, jbtnSaveHTML); jbtnPrint = new JButtonNoFocus(getEkitIcon("Print")); jbtnPrint.setToolTipText(Translatrix.getTranslationString("PrintDocument")); jbtnPrint.setActionCommand(CMD_DOC_PRINT); jbtnPrint.addActionListener(this); htTools.put(KEY_TOOL_PRINT, jbtnPrint); // jbtnCut = new JButtonNoFocus(new DefaultEditorKit.CutAction()); jbtnCut = new JButtonNoFocus(); jbtnCut.setActionCommand(CMD_CLIP_CUT); jbtnCut.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { EkitCore.this.actionPerformed(evt); } }); jbtnCut.setIcon(getEkitIcon("Cut")); jbtnCut.setText(null); jbtnCut.setToolTipText(Translatrix.getTranslationString("Cut")); htTools.put(KEY_TOOL_CUT, jbtnCut); // jbtnCopy = new JButtonNoFocus(new DefaultEditorKit.CopyAction()); jbtnCopy = new JButtonNoFocus(); jbtnCopy.setActionCommand(CMD_CLIP_COPY); jbtnCopy.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { EkitCore.this.actionPerformed(evt); } }); jbtnCopy.setIcon(getEkitIcon("Copy")); jbtnCopy.setText(null); jbtnCopy.setToolTipText(Translatrix.getTranslationString("Copy")); htTools.put(KEY_TOOL_COPY, jbtnCopy); // jbtnPaste = new JButtonNoFocus(new DefaultEditorKit.PasteAction()); jbtnPaste = new JButtonNoFocus(); jbtnPaste.setActionCommand(CMD_CLIP_PASTE); jbtnPaste.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { EkitCore.this.actionPerformed(evt); } }); jbtnPaste.setIcon(getEkitIcon("Paste")); jbtnPaste.setText(null); jbtnPaste.setToolTipText(Translatrix.getTranslationString("Paste")); htTools.put(KEY_TOOL_PASTE, jbtnPaste); jbtnPasteX = new JButtonNoFocus(); jbtnPasteX.setActionCommand(CMD_CLIP_PASTE_PLAIN); jbtnPasteX.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { EkitCore.this.actionPerformed(evt); } }); jbtnPasteX.setIcon(getEkitIcon("PasteUnformatted")); jbtnPasteX.setText(null); jbtnPasteX.setToolTipText(Translatrix.getTranslationString("PasteUnformatted")); htTools.put(KEY_TOOL_PASTEX, jbtnPasteX); jbtnUndo = new JButtonNoFocus(undoAction); jbtnUndo.setIcon(getEkitIcon("Undo")); jbtnUndo.setText(null); jbtnUndo.setToolTipText(Translatrix.getTranslationString("Undo")); htTools.put(KEY_TOOL_UNDO, jbtnUndo); jbtnRedo = new JButtonNoFocus(redoAction); jbtnRedo.setIcon(getEkitIcon("Redo")); jbtnRedo.setText(null); jbtnRedo.setToolTipText(Translatrix.getTranslationString("Redo")); htTools.put(KEY_TOOL_REDO, jbtnRedo); jbtnBold = new JButtonNoFocus(actionFontBold); jbtnBold.setIcon(getEkitIcon("Bold")); jbtnBold.setText(null); jbtnBold.setToolTipText(Translatrix.getTranslationString("FontBold")); htTools.put(KEY_TOOL_BOLD, jbtnBold); jbtnItalic = new JButtonNoFocus(actionFontItalic); jbtnItalic.setIcon(getEkitIcon("Italic")); jbtnItalic.setText(null); jbtnItalic.setToolTipText(Translatrix.getTranslationString("FontItalic")); htTools.put(KEY_TOOL_ITALIC, jbtnItalic); jbtnUnderline = new JButtonNoFocus(actionFontUnderline); jbtnUnderline.setIcon(getEkitIcon("Underline")); jbtnUnderline.setText(null); jbtnUnderline.setToolTipText(Translatrix.getTranslationString("FontUnderline")); htTools.put(KEY_TOOL_UNDERLINE, jbtnUnderline); jbtnStrike = new JButtonNoFocus(actionFontStrike); jbtnStrike.setIcon(getEkitIcon("Strike")); jbtnStrike.setText(null); jbtnStrike.setToolTipText(Translatrix.getTranslationString("FontStrike")); htTools.put(KEY_TOOL_STRIKE, jbtnStrike); jbtnSuperscript = new JButtonNoFocus(actionFontSuperscript); jbtnSuperscript.setIcon(getEkitIcon("Super")); jbtnSuperscript.setText(null); jbtnSuperscript.setToolTipText(Translatrix.getTranslationString("FontSuperscript")); htTools.put(KEY_TOOL_SUPER, jbtnSuperscript); jbtnSubscript = new JButtonNoFocus(actionFontSubscript); jbtnSubscript.setIcon(getEkitIcon("Sub")); jbtnSubscript.setText(null); jbtnSubscript.setToolTipText(Translatrix.getTranslationString("FontSubscript")); htTools.put(KEY_TOOL_SUB, jbtnSubscript); jbtnUList = new JButtonNoFocus(actionListUnordered); jbtnUList.setIcon(getEkitIcon("UList")); jbtnUList.setText(null); jbtnUList.setToolTipText(Translatrix.getTranslationString("ListUnordered")); htTools.put(KEY_TOOL_ULIST, jbtnUList); jbtnOList = new JButtonNoFocus(actionListOrdered); jbtnOList.setIcon(getEkitIcon("OList")); jbtnOList.setText(null); jbtnOList.setToolTipText(Translatrix.getTranslationString("ListOrdered")); htTools.put(KEY_TOOL_OLIST, jbtnOList); jbtnAlignLeft = new JButtonNoFocus(actionAlignLeft); jbtnAlignLeft.setIcon(getEkitIcon("AlignLeft")); jbtnAlignLeft.setText(null); jbtnAlignLeft.setToolTipText(Translatrix.getTranslationString("AlignLeft")); htTools.put(KEY_TOOL_ALIGNL, jbtnAlignLeft); jbtnAlignCenter = new JButtonNoFocus(actionAlignCenter); jbtnAlignCenter.setIcon(getEkitIcon("AlignCenter")); jbtnAlignCenter.setText(null); jbtnAlignCenter.setToolTipText(Translatrix.getTranslationString("AlignCenter")); htTools.put(KEY_TOOL_ALIGNC, jbtnAlignCenter); jbtnAlignRight = new JButtonNoFocus(actionAlignRight); jbtnAlignRight.setIcon(getEkitIcon("AlignRight")); jbtnAlignRight.setText(null); jbtnAlignRight.setToolTipText(Translatrix.getTranslationString("AlignRight")); htTools.put(KEY_TOOL_ALIGNR, jbtnAlignRight); jbtnAlignJustified = new JButtonNoFocus(actionAlignJustified); jbtnAlignJustified.setIcon(getEkitIcon("AlignJustified")); jbtnAlignJustified.setText(null); jbtnAlignJustified.setToolTipText(Translatrix.getTranslationString("AlignJustified")); htTools.put(KEY_TOOL_ALIGNJ, jbtnAlignJustified); jbtnUnicode = new JButtonNoFocus(); jbtnUnicode.setActionCommand(CMD_INSERT_UNICODE_CHAR); jbtnUnicode.addActionListener(this); jbtnUnicode.setIcon(getEkitIcon("Unicode")); jbtnUnicode.setText(null); jbtnUnicode.setToolTipText(Translatrix.getTranslationString("ToolUnicode")); htTools.put(KEY_TOOL_UNICODE, jbtnUnicode); jbtnUnicodeMath = new JButtonNoFocus(); jbtnUnicodeMath.setActionCommand(CMD_INSERT_UNICODE_MATH); jbtnUnicodeMath.addActionListener(this); jbtnUnicodeMath.setIcon(getEkitIcon("Math")); jbtnUnicodeMath.setText(null); jbtnUnicodeMath.setToolTipText(Translatrix.getTranslationString("ToolUnicodeMath")); htTools.put(KEY_TOOL_UNIMATH, jbtnUnicodeMath); jbtnFind = new JButtonNoFocus(); jbtnFind.setActionCommand(CMD_SEARCH_FIND); jbtnFind.addActionListener(this); jbtnFind.setIcon(getEkitIcon("Find")); jbtnFind.setText(null); jbtnFind.setToolTipText(Translatrix.getTranslationString("SearchFind")); htTools.put(KEY_TOOL_FIND, jbtnFind); jbtnAnchor = new JButtonNoFocus(actionInsertAnchor); jbtnAnchor.setIcon(getEkitIcon("Anchor")); jbtnAnchor.setText(null); jbtnAnchor.setToolTipText(Translatrix.getTranslationString("ToolAnchor")); htTools.put(KEY_TOOL_ANCHOR, jbtnAnchor); jtbtnViewSource = new JToggleButtonNoFocus(getEkitIcon("Source")); jtbtnViewSource.setText(null); jtbtnViewSource.setToolTipText(Translatrix.getTranslationString("ViewSource")); jtbtnViewSource.setActionCommand(CMD_TOGGLE_SOURCE_VIEW); jtbtnViewSource.addActionListener(this); jtbtnViewSource.setPreferredSize(jbtnAnchor.getPreferredSize()); jtbtnViewSource.setMinimumSize(jbtnAnchor.getMinimumSize()); jtbtnViewSource.setMaximumSize(jbtnAnchor.getMaximumSize()); htTools.put(KEY_TOOL_SOURCE, jtbtnViewSource); jcmbStyleSelector = new JComboBoxNoFocus(); jcmbStyleSelector.setToolTipText(Translatrix.getTranslationString("PickCSSStyle")); jcmbStyleSelector.setAction(new StylesAction(jcmbStyleSelector)); htTools.put(KEY_TOOL_STYLES, jcmbStyleSelector); String[] fonts = java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames(); Vector<String> vcFontnames = new Vector<String>(fonts.length + 1); vcFontnames.add(Translatrix.getTranslationString("SelectorToolFontsDefaultFont")); for (String fontname : fonts) { vcFontnames.add(fontname); } Collections.sort(vcFontnames); jcmbFontSelector = new JComboBoxNoFocus(vcFontnames); jcmbFontSelector.setAction(new SetFontFamilyAction(this, "[EKITFONTSELECTOR]")); htTools.put(KEY_TOOL_FONTS, jcmbFontSelector); jbtnInsertTable = new JButtonNoFocus(); jbtnInsertTable.setActionCommand(CMD_TABLE_INSERT); jbtnInsertTable.addActionListener(this); jbtnInsertTable.setIcon(getEkitIcon("TableCreate")); jbtnInsertTable.setText(null); jbtnInsertTable.setToolTipText(Translatrix.getTranslationString("InsertTable")); htTools.put(KEY_TOOL_INSTABLE, jbtnInsertTable); jbtnEditTable = new JButtonNoFocus(); jbtnEditTable.setActionCommand(CMD_TABLE_EDIT); jbtnEditTable.addActionListener(this); jbtnEditTable.setIcon(getEkitIcon("TableEdit")); jbtnEditTable.setText(null); jbtnEditTable.setToolTipText(Translatrix.getTranslationString("TableEdit")); htTools.put(KEY_TOOL_EDITTABLE, jbtnEditTable); jbtnEditCell = new JButtonNoFocus(); jbtnEditCell.setActionCommand(CMD_TABLE_CELL_EDIT); jbtnEditCell.addActionListener(this); jbtnEditCell.setIcon(getEkitIcon("CellEdit")); jbtnEditCell.setText(null); jbtnEditCell.setToolTipText(Translatrix.getTranslationString("TableCellEdit")); htTools.put(KEY_TOOL_EDITCELL, jbtnEditCell); jbtnInsertRow = new JButtonNoFocus(); jbtnInsertRow.setActionCommand(CMD_TABLE_ROW_INSERT); jbtnInsertRow.addActionListener(this); jbtnInsertRow.setIcon(getEkitIcon("InsertRow")); jbtnInsertRow.setText(null); jbtnInsertRow.setToolTipText(Translatrix.getTranslationString("InsertTableRow")); htTools.put(KEY_TOOL_INSERTROW, jbtnInsertRow); jbtnInsertColumn = new JButtonNoFocus(); jbtnInsertColumn.setActionCommand(CMD_TABLE_COLUMN_INSERT); jbtnInsertColumn.addActionListener(this); jbtnInsertColumn.setIcon(getEkitIcon("InsertColumn")); jbtnInsertColumn.setText(null); jbtnInsertColumn.setToolTipText(Translatrix.getTranslationString("InsertTableColumn")); htTools.put(KEY_TOOL_INSERTCOL, jbtnInsertColumn); jbtnDeleteRow = new JButtonNoFocus(); jbtnDeleteRow.setActionCommand(CMD_TABLE_ROW_DELETE); jbtnDeleteRow.addActionListener(this); jbtnDeleteRow.setIcon(getEkitIcon("DeleteRow")); jbtnDeleteRow.setText(null); jbtnDeleteRow.setToolTipText(Translatrix.getTranslationString("DeleteTableRow")); htTools.put(KEY_TOOL_DELETEROW, jbtnDeleteRow); jbtnDeleteColumn = new JButtonNoFocus(); jbtnDeleteColumn.setActionCommand(CMD_TABLE_COLUMN_DELETE); jbtnDeleteColumn.addActionListener(this); jbtnDeleteColumn.setIcon(getEkitIcon("DeleteColumn")); jbtnDeleteColumn.setText(null); jbtnDeleteColumn.setToolTipText(Translatrix.getTranslationString("DeleteTableColumn")); htTools.put(KEY_TOOL_DELETECOL, jbtnDeleteColumn); jbtnMaximize = new JButtonNoFocus(); jbtnMaximize.setActionCommand(CMD_MAXIMIZE); jbtnMaximize.addActionListener(this); jbtnMaximize.setIcon(getEkitIcon("Maximize")); jbtnMaximize.setText(null); jbtnMaximize.setToolTipText(Translatrix.getTranslationString("Maximize")); htTools.put(KEY_TOOL_MAXIMIZE, jbtnMaximize); jbtnClearFormat = new JButtonNoFocus(actionClearFormat); jbtnClearFormat.setIcon(getEkitIcon("ClearFormat")); jbtnClearFormat.setText(null); jbtnClearFormat.setToolTipText(Translatrix.getTranslationString("ClearFormat")); htTools.put(KEY_TOOL_CLEAR_FORMAT, jbtnClearFormat); jbtnSpecialChar = new JButtonNoFocus(actionSpecialChar); jbtnSpecialChar.setIcon(getEkitIcon("SpecialChar")); jbtnSpecialChar.setText(null); jbtnSpecialChar.setToolTipText(Translatrix.getTranslationString("SpecialChar")); htTools.put(KEY_TOOL_SPECIAL_CHAR, jbtnSpecialChar); jbtnTableButtonMenu = new JButtonNoFocus(actionTableButtonMenu); jbtnTableButtonMenu.setText(null); htTools.put(KEY_TOOL_TABLE_MENU, jbtnTableButtonMenu); /* Create the toolbar */ if (multiBar) { jToolBarMain = new JToolBar(JToolBar.HORIZONTAL); jToolBarMain.setFloatable(false); jToolBarFormat = new JToolBar(JToolBar.HORIZONTAL); jToolBarFormat.setFloatable(false); jToolBarStyles = new JToolBar(JToolBar.HORIZONTAL); jToolBarStyles.setFloatable(false); initializeMultiToolbars(toolbarSeq); // fix the weird size preference of toggle buttons jtbtnViewSource.setPreferredSize(jbtnAnchor.getPreferredSize()); jtbtnViewSource.setMinimumSize(jbtnAnchor.getMinimumSize()); jtbtnViewSource.setMaximumSize(jbtnAnchor.getMaximumSize()); } else if (includeToolBar) { jToolBar = new JToolBar(JToolBar.HORIZONTAL); jToolBar.setFloatable(false); initializeSingleToolbar(toolbarSeq); // fix the weird size preference of toggle buttons jtbtnViewSource.setPreferredSize(jbtnAnchor.getPreferredSize()); jtbtnViewSource.setMinimumSize(jbtnAnchor.getMinimumSize()); jtbtnViewSource.setMaximumSize(jbtnAnchor.getMaximumSize()); } /* Create the scroll area for the text pane */ jspViewport = new JScrollPane(jtpMain); jspViewport.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); jspViewport.setPreferredSize(new Dimension(400, 400)); jspViewport.setMinimumSize(new Dimension(32, 32)); /* Create the scroll area for the source viewer */ jspSource = new JScrollPane(jtpSource); jspSource.setPreferredSize(new Dimension(400, 100)); jspSource.setMinimumSize(new Dimension(32, 32)); displayPanel = new JPanel(); displayPanel.setLayout(new CardLayout()); displayPanel.add(jspViewport, PANEL_NAME_MAIN); displayPanel.add(jspSource, PANEL_NAME_SOURCE); if (showViewSource) { toggleSourceWindow(); } registerDocumentStyles(); tableCtl = new TableController(this); htmlDoc.setInlineEdit(inlineEdit); htmlDoc.addFilter(new HTMLTableDocumentFilter()); // Inicializa documento pelos behaviors for (HTMLDocumentBehavior b : this.behaviors) { b.initializeDocument(jtpMain); } htmlDoc.getBehaviors().addAll(this.behaviors); /* Add the components to the app */ this.setLayout(new BorderLayout()); this.add(displayPanel, BorderLayout.CENTER); }
From source file:GUI.MainWindow.java
/** * @param args the command line arguments *///from w ww. j a v a2s . c om public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(MainWindow.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(MainWindow.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(MainWindow.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(MainWindow.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> // Create right click context menu for most Text Components final JPopupMenu copypaste = new JPopupMenu(); JMenuItem cut = new JMenuItem(new DefaultEditorKit.CutAction()); cut.setText("Cut"); copypaste.add(cut); JMenuItem copy = new JMenuItem(new DefaultEditorKit.CopyAction()); copy.setText("Copy"); copypaste.add(copy); JMenuItem paste = new JMenuItem(new DefaultEditorKit.PasteAction()); paste.setText("Paste"); copypaste.add(paste); // Taken from here. It succinctly added a right click context menu to every text component. // http://stackoverflow.com/questions/19424574/adding-a-context-menu-to-all-swing-text-components-in-application javax.swing.UIManager.addAuxiliaryLookAndFeel(new LookAndFeel() { private final UIDefaults defaults = new UIDefaults() { public javax.swing.plaf.ComponentUI getUI(JComponent c) { if (c instanceof javax.swing.text.JTextComponent) { if (c.getClientProperty(this) == null) { c.setComponentPopupMenu(copypaste); c.putClientProperty(this, Boolean.TRUE); } } return null; } }; @Override public UIDefaults getDefaults() { return defaults; } ; @Override public String getID() { return "TextContextMenu"; } @Override public String getName() { return getID(); } @Override public String getDescription() { return getID(); } @Override public boolean isNativeLookAndFeel() { return false; } @Override public boolean isSupportedLookAndFeel() { return true; } }); /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new MainWindow().setVisible(true); } }); }
From source file:edu.ku.brc.ui.UIRegistry.java
public JMenu createEditMenu() { JMenu menu = new JMenu(getResourceString("EDIT")); menu.setMnemonic(KeyEvent.VK_E); // Undo and redo are actions of our own creation. undoAction = (UndoAction) makeAction(UndoAction.class, this, "Undo", null, null, new Integer(KeyEvent.VK_Z), KeyStroke.getKeyStroke(KeyEvent.VK_Z, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); register(UNDO, menu.add(undoAction)); actionMap.put(UNDO, undoAction);// ww w . ja v a2 s .com redoAction = (RedoAction) makeAction(RedoAction.class, this, "Redo", null, null, new Integer(KeyEvent.VK_Y), KeyStroke.getKeyStroke(KeyEvent.VK_Y, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); register(REDO, menu.add(redoAction)); actionMap.put(REDO, redoAction); menu.addSeparator(); // These actions come from the default editor kit. Get the ones we want // and stick them in the menu. Action cutAction = makeAction(DefaultEditorKit.CutAction.class, null, "Cut", null, "Cut selection to clipboard", // I18N ???? new Integer(KeyEvent.VK_X), KeyStroke.getKeyStroke(KeyEvent.VK_X, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); register(CUT, menu.add(cutAction)); cutAction.setEnabled(false); actionMap.put(CUT, cutAction); Action copyAction = makeAction(DefaultEditorKit.CopyAction.class, null, "Copy", null, "Copy selection to clipboard", new Integer(KeyEvent.VK_C), KeyStroke.getKeyStroke(KeyEvent.VK_C, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); register(COPY, menu.add(copyAction)); copyAction.setEnabled(false); actionMap.put(COPY, copyAction); Action pasteAction = makeAction(DefaultEditorKit.PasteAction.class, null, "Paste", null, "Paste contents of clipboard", new Integer(KeyEvent.VK_V), KeyStroke.getKeyStroke(KeyEvent.VK_V, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); pasteAction.setEnabled(false); register(PASTE, menu.add(pasteAction)); actionMap.put(PASTE, pasteAction); /* menu.addSeparator(); Action selectAllAction = makeAction(SelectAllAction.class, this, "Select All", null, "Select all text", new Integer(KeyEvent.VK_A), KeyStroke.getKeyStroke(KeyEvent.VK_A, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); menu.add(selectAllAction); */ launchFindReplaceAction = (LaunchFindReplaceAction) makeAction(LaunchFindReplaceAction.class, this, "Find", null, null, new Integer(KeyEvent.VK_F), KeyStroke.getKeyStroke(KeyEvent.VK_F, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); //menu.add(launchFindReplaceAction); // launchFindReplaceAction.setEnabled(false); // register(FIND, menu.add(launchFindReplaceAction)); // actionMap.put(FIND, launchFindReplaceAction); launchFindReplaceAction.setEnabled(false); register(FIND, menu.add(launchFindReplaceAction)); actionMap.put(FIND, launchFindReplaceAction); return menu; }
From source file:org.executequery.util.LookAndFeelLoader.java
private void applyMacSettings() { if (UIUtils.isMac()) { String[] textComponents = { "TextField", "TextPane", "TextArea", "EditorPane", "PasswordField" }; for (String textComponent : textComponents) { InputMap im = (InputMap) UIManager.get(textComponent + ".focusInputMap"); im.put(KeyStroke.getKeyStroke(KeyEvent.VK_C, KeyEvent.META_DOWN_MASK), DefaultEditorKit.copyAction); im.put(KeyStroke.getKeyStroke(KeyEvent.VK_V, KeyEvent.META_DOWN_MASK), DefaultEditorKit.pasteAction); im.put(KeyStroke.getKeyStroke(KeyEvent.VK_X, KeyEvent.META_DOWN_MASK), DefaultEditorKit.cutAction); }// ww w. j av a2 s.c om if (UIUtils.isNativeMacLookAndFeel()) { UIManager.put("Table.gridColor", UIUtils.getDefaultBorderColour()); } } }
From source file:org.languagetool.gui.Main.java
private JMenuBar createMenuBar() { JMenuBar menuBar = new JMenuBar(); JMenu fileMenu = new JMenu(getLabel("guiMenuFile")); fileMenu.setMnemonic(getMnemonic("guiMenuFile")); JMenu editMenu = new JMenu(getLabel("guiMenuEdit")); editMenu.setMnemonic(getMnemonic("guiMenuEdit")); JMenu grammarMenu = new JMenu(getLabel("guiMenuGrammar")); grammarMenu.setMnemonic(getMnemonic("guiMenuGrammar")); JMenu helpMenu = new JMenu(getLabel("guiMenuHelp")); helpMenu.setMnemonic(getMnemonic("guiMenuHelp")); fileMenu.add(openAction);//from w w w . j a v a 2s.co m fileMenu.add(saveAction); fileMenu.add(saveAsAction); recentFilesMenu = new JMenu(getLabel("guiMenuRecentFiles")); recentFilesMenu.setMnemonic(getMnemonic("guiMenuRecentFiles")); fileMenu.add(recentFilesMenu); updateRecentFilesMenu(); fileMenu.addSeparator(); fileMenu.add(new HideAction()); fileMenu.addSeparator(); fileMenu.add(new QuitAction()); grammarMenu.add(checkAction); JCheckBoxMenuItem item = new JCheckBoxMenuItem(autoCheckAction); grammarMenu.add(item); JCheckBoxMenuItem showResult = new JCheckBoxMenuItem(showResultAction); grammarMenu.add(showResult); grammarMenu.add(new CheckClipboardAction()); grammarMenu.add(new TagTextAction()); grammarMenu.add(new AddRulesAction()); grammarMenu.add(new OptionsAction()); grammarMenu.add(new SelectFontAction()); JMenu lafMenu = new JMenu(messages.getString("guiLookAndFeelMenu")); UIManager.LookAndFeelInfo[] lafInfo = UIManager.getInstalledLookAndFeels(); ButtonGroup buttonGroup = new ButtonGroup(); for (UIManager.LookAndFeelInfo laf : lafInfo) { if (!"Nimbus".equals(laf.getName())) { continue; } addLookAndFeelMenuItem(lafMenu, laf, buttonGroup); } for (UIManager.LookAndFeelInfo laf : lafInfo) { if ("Nimbus".equals(laf.getName())) { continue; } addLookAndFeelMenuItem(lafMenu, laf, buttonGroup); } grammarMenu.add(lafMenu); helpMenu.add(new AboutAction()); undoRedo.undoAction.putValue(Action.NAME, getLabel("guiMenuUndo")); undoRedo.undoAction.putValue(Action.MNEMONIC_KEY, getMnemonic("guiMenuUndo")); undoRedo.redoAction.putValue(Action.NAME, getLabel("guiMenuRedo")); undoRedo.redoAction.putValue(Action.MNEMONIC_KEY, getMnemonic("guiMenuRedo")); editMenu.add(undoRedo.undoAction); editMenu.add(undoRedo.redoAction); editMenu.addSeparator(); Action cutAction = new DefaultEditorKit.CutAction(); cutAction.putValue(Action.SMALL_ICON, getImageIcon("sc_cut.png")); cutAction.putValue(Action.LARGE_ICON_KEY, getImageIcon("lc_cut.png")); cutAction.putValue(Action.NAME, getLabel("guiMenuCut")); cutAction.putValue(Action.MNEMONIC_KEY, KeyEvent.VK_T); editMenu.add(cutAction); Action copyAction = new DefaultEditorKit.CopyAction(); copyAction.putValue(Action.SMALL_ICON, getImageIcon("sc_copy.png")); copyAction.putValue(Action.LARGE_ICON_KEY, getImageIcon("lc_copy.png")); copyAction.putValue(Action.NAME, getLabel("guiMenuCopy")); copyAction.putValue(Action.MNEMONIC_KEY, KeyEvent.VK_C); editMenu.add(copyAction); Action pasteAction = new DefaultEditorKit.PasteAction(); pasteAction.putValue(Action.SMALL_ICON, getImageIcon("sc_paste.png")); pasteAction.putValue(Action.LARGE_ICON_KEY, getImageIcon("lc_paste.png")); pasteAction.putValue(Action.NAME, getLabel("guiMenuPaste")); pasteAction.putValue(Action.MNEMONIC_KEY, KeyEvent.VK_P); editMenu.add(pasteAction); editMenu.addSeparator(); editMenu.add(new SelectAllAction()); menuBar.add(fileMenu); menuBar.add(editMenu); menuBar.add(grammarMenu); menuBar.add(helpMenu); return menuBar; }
From source file:org.pentaho.ui.xul.swing.tags.SwingWindow.java
public void paste() { TextAction act = new DefaultEditorKit.PasteAction(); act.actionPerformed(new ActionEvent(this.getManagedObject(), 999, "paste")); }
From source file:org.planetcrypto.bitcoin.PlanetCryptoBitcoinUI.java
/** * 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 Form Editor.//from w w w .j a va 2s.c o m */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { bindingGroup = new org.jdesktop.beansbinding.BindingGroup(); MainTabbedPane = new javax.swing.JTabbedPane(); MinerInformationPanel = new javax.swing.JPanel(); MinerInformationTabbedPane = new javax.swing.JTabbedPane(); InformationPanel = new javax.swing.JPanel(); MinerSelectionBox = new javax.swing.JComboBox(); MinerSelectionBoxLabel = new javax.swing.JLabel(); InformationMinerIPLabel = new javax.swing.JLabel(); InformationMinerIPTextField = new javax.swing.JTextField(); InformationMinerPortLabel = new javax.swing.JLabel(); InformationMinerPortTextField = new javax.swing.JTextField(); PrivilegedLabel = new javax.swing.JLabel(); ASICsLabel = new javax.swing.JLabel(); PrivilegedTextField = new javax.swing.JTextField(); ASICsTextField = new javax.swing.JTextField(); PGAsLabel = new javax.swing.JLabel(); PGAsTextField = new javax.swing.JTextField(); PoolCountLabel = new javax.swing.JLabel(); PoolCountTextField = new javax.swing.JTextField(); MinerVersionLabel = new javax.swing.JLabel(); MinerVersionTextField = new javax.swing.JTextField(); MinerStrategyLabel = new javax.swing.JLabel(); MinerStrategyTextField = new javax.swing.JTextField(); ACSChain1Label = new javax.swing.JLabel(); ACSChain1TextField = new javax.swing.JTextField(); ACSChain2Label = new javax.swing.JLabel(); ACSChain3Label = new javax.swing.JLabel(); ACSChain4Label = new javax.swing.JLabel(); ACSChain2TextField = new javax.swing.JTextField(); ACSChain3TextField = new javax.swing.JTextField(); ACSChain4TextField = new javax.swing.JTextField(); BytesSentLabel = new javax.swing.JLabel(); BytesRecvLabel = new javax.swing.JLabel(); BytesSentTextField = new javax.swing.JTextField(); BytesRecvTextField = new javax.swing.JTextField(); HWErrorPercentLabel = new javax.swing.JLabel(); HWErrorPercentageTextField = new javax.swing.JTextField(); HWErrorsLabel = new javax.swing.JLabel(); HWErrorsTextField = new javax.swing.JTextField(); ACSChainInformationLabel = new javax.swing.JLabel(); MinerGenericInformationRefreshButton = new javax.swing.JButton(); MinerHashRatesPanel = new javax.swing.JPanel(); HashRatesCurrentMiner = new javax.swing.JLabel(); MinerCurrentHashLabel = new javax.swing.JLabel(); MinerCurrentHashTextField = new javax.swing.JTextField(); MinerAverageHashLabel = new javax.swing.JLabel(); MinerAverageHashTextField = new javax.swing.JTextField(); MinerFoundBlocksLabel = new javax.swing.JLabel(); MinerAcceptedLabel = new javax.swing.JLabel(); MinerRejectedLabel = new javax.swing.JLabel(); MinerBestShareLabel = new javax.swing.JLabel(); MinerNetworkBlocksLabel = new javax.swing.JLabel(); MinerFoundBlocksTextField = new javax.swing.JTextField(); MinerAcceptedTextField = new javax.swing.JTextField(); MinerRejectedTextField = new javax.swing.JTextField(); MinerBestShareTextField = new javax.swing.JTextField(); MinerNetworkBlocksTextField = new javax.swing.JTextField(); MinerSelectionBox1 = new javax.swing.JComboBox(); MinerHashRatesRefreshButton = new javax.swing.JButton(); MinerTemperaturePanel = new javax.swing.JPanel(); TemperatureCurrentMinerLabel = new javax.swing.JLabel(); MinerTemp1Label = new javax.swing.JLabel(); MinerTemp2Label = new javax.swing.JLabel(); MinerTemp3Label = new javax.swing.JLabel(); MinerTemp4Label = new javax.swing.JLabel(); MinerTempAvgLabel = new javax.swing.JLabel(); MinerTempMaxLabel = new javax.swing.JLabel(); MinerTemp1TextField = new javax.swing.JTextField(); MinerTemp2TextField = new javax.swing.JTextField(); MinerTemp3TextField = new javax.swing.JTextField(); MinerTemp4TextField = new javax.swing.JTextField(); MinerTempAvgTextField = new javax.swing.JTextField(); MinerTextMaxTextField = new javax.swing.JTextField(); MinerSelectionBox2 = new javax.swing.JComboBox(); MinerTemperaturesRefreshButton = new javax.swing.JButton(); MinerFansPanel = new javax.swing.JPanel(); FansCurrentMinerLabel = new javax.swing.JLabel(); MinerFan1Label = new javax.swing.JLabel(); MinerFan2Label = new javax.swing.JLabel(); MinerFan3Label = new javax.swing.JLabel(); MinerFan4Label = new javax.swing.JLabel(); MinerFan1TextField = new javax.swing.JTextField(); MinerFan2TextField = new javax.swing.JTextField(); MinerFan3TextField = new javax.swing.JTextField(); MinerFan4TextField = new javax.swing.JTextField(); MinerSelectionBox3 = new javax.swing.JComboBox(); MinerFanSpeedsRefreshButton = new javax.swing.JButton(); CustomAPICommandPanel = new javax.swing.JPanel(); CustomAPICommandCurrentMiner = new javax.swing.JLabel(); CustomCommandEntryLabel = new javax.swing.JLabel(); CustomCommandEntryTextField = new javax.swing.JTextField(); CustomCommandOutputScrollPane = new javax.swing.JScrollPane(); CustomCommandOutputTextArea = new javax.swing.JTextArea(); CustomCommandOutputLabel = new javax.swing.JLabel(); CustomCommandSubmitButton = new javax.swing.JButton(); CustomCommandJsonCheckBox = new javax.swing.JCheckBox(); CustomCommandMinerSelectionBox = new javax.swing.JComboBox(); MinerVitalsPanel = new javax.swing.JPanel(); jScrollPane2 = new javax.swing.JScrollPane(); MinerVitalStatsTextPane = new javax.swing.JTextPane(); jLabel1 = new javax.swing.JLabel(); VitalStatsRefreshButton = new javax.swing.JButton(); BTCInformationPane = new javax.swing.JPanel(); BitcoinInformationTabbedPane = new javax.swing.JTabbedPane(); BTCGenericInformationPanel = new javax.swing.JPanel(); BTCConversionRateLabel = new javax.swing.JLabel(); NetworkDifficultyLabel = new javax.swing.JLabel(); EstimatedPayoutLabel = new javax.swing.JLabel(); NetworkDifficultyTextField = new javax.swing.JTextField(); BTCConversionRateTextField = new javax.swing.JTextField(); EstimatedPayoutTextField = new javax.swing.JTextField(); CurrentBlockHashLabel = new javax.swing.JLabel(); CurrentBlockHashTextField = new javax.swing.JTextField(); CurrentBlockTimeLabel = new javax.swing.JLabel(); CurrentBlockTimeTextField = new javax.swing.JTextField(); GenericInformationCurrentMinerLabel = new javax.swing.JLabel(); MinerSelectionBox5 = new javax.swing.JComboBox(); BitcoinInformationRefreshButton = new javax.swing.JButton(); GenericInformationCoinbaseUserLabel = new javax.swing.JLabel(); GenericInformationCoinbaseUserSelectionBox = new javax.swing.JComboBox(); GenericInformationAbbreviatedPreferredCurrencyLabel = new javax.swing.JLabel(); GenericInformationAbbreviatedPreferredCurrencyLabel2 = new javax.swing.JLabel(); CoinbaseAPIPanel = new javax.swing.JPanel(); CoinbaseAPILabel = new javax.swing.JLabel(); CoinbaseAPICurrentUserLabel = new javax.swing.JLabel(); CoinbaseAPIUserSelectionBox = new javax.swing.JComboBox(); EligiusPoolInformationPanel = new javax.swing.JPanel(); EligiusStatusLabel = new javax.swing.JLabel(); EligiusHashRateInformationScrollPane = new javax.swing.JScrollPane(); EligiusHashRateInformationTable = new javax.swing.JTable(); EligiusPayoutInformationPayoutScrollPane = new javax.swing.JScrollPane(); EligiusPayoutInformationTable = new javax.swing.JTable(); EligiusPoolInformationRefreshButton = new javax.swing.JButton(); EligiusPayoutKeyInformationScrollPane = new javax.swing.JScrollPane(); EligiousPayoutKeyInformationTextPane = new javax.swing.JTextPane(); EligiusUsernameSelectionBox = new javax.swing.JComboBox(); EligiusUsernameClipboardCopyButton = new javax.swing.JButton(); EligiusPoolCurrentUsernameLabel = new javax.swing.JLabel(); EligiusOpenBrowserButton = new javax.swing.JButton(); ConfigurationPanel = new javax.swing.JPanel(); ConfigurationTabbedPane = new javax.swing.JTabbedPane(); MinerConfigurationPanel = new javax.swing.JPanel(); ConfigurationPromptLabel = new javax.swing.JLabel(); ConfigurationRemoveMinerButton = new javax.swing.JButton(); ConfigurationAddMinerButton = new javax.swing.JButton(); ConfigurationAddMinerNameLabel = new javax.swing.JLabel(); ConfigurationAddMinerNameTextField = new javax.swing.JTextField(); ConfigurationAddMinerIPLabel = new javax.swing.JLabel(); ConfigurationAddMinerIPTextField = new javax.swing.JTextField(); ConfigurationMinerPortLabel = new javax.swing.JLabel(); ConfigurationMinerPortTextField = new javax.swing.JTextField(); ConfigurationAddMinersLabel = new javax.swing.JLabel(); ConfigurationRemoveMinersLabel = new javax.swing.JLabel(); ConfigurationRemoveMinerNameLabel = new javax.swing.JLabel(); ConfigurationRemoveMinerNameTextField = new javax.swing.JTextField(); ConfigurationCurrentMinersLabel = new javax.swing.JLabel(); ConfigurationRemoveMinerIPLabel = new javax.swing.JLabel(); ConfigurationRemoveMinerIPTextField = new javax.swing.JTextField(); ConfigurationResolveHostAddressLabel = new javax.swing.JLabel(); ConfigurationResolveHostAddressTextField = new javax.swing.JTextField(); ConfigurationResolveHostAddressButton = new javax.swing.JButton(); ConfigurationCurrentMinersScrollPane = new javax.swing.JScrollPane(); ConfigurationCurrentMinersTextPane = new javax.swing.JTextPane(); ConfigurationAlarmPanel = new javax.swing.JPanel(); ConfigurationAlarmSettingsPromptLabel = new javax.swing.JLabel(); ConfigurationMinerTemperatureAlarmLabel = new javax.swing.JLabel(); ConfigurationMinerFanSpeedAlarmLabel = new javax.swing.JLabel(); ConfigurationMinerHashRateAlarmLabel = new javax.swing.JLabel(); MinerSelectionForAlarmsBox = new javax.swing.JComboBox(); AlarmsCurrentMinerLabel = new javax.swing.JLabel(); ConfigurationAlarmsHWErrPercentLabel = new javax.swing.JLabel(); ConfigurationMinerTempAlarmTextField = new javax.swing.JTextField(); ConfigurationFanSpeedAlarmTextField = new javax.swing.JTextField(); ConfigurationMinerHashRateAlarmTextField = new javax.swing.JTextField(); ConfigurationMinerHardwareErrPercentAlarmTextField = new javax.swing.JTextField(); ConfigurationDegreesCelsiusLabel = new javax.swing.JLabel(); ConfigurationFanRPMLabel = new javax.swing.JLabel(); ConfigurationHashRatePostfixComboBox = new javax.swing.JComboBox(); ConfigurationHWErrorPercentLabel = new javax.swing.JLabel(); ConfigurationMinerTempAlarmUpdateButton = new javax.swing.JButton(); ConfigurationMinerFanSpeedAlarmUpdateButton = new javax.swing.JButton(); ConfigurationMinerHashRateAlarmUpdateButton = new javax.swing.JButton(); ConfigurationMinerHardwareErrPercentAlarmUpdateButton = new javax.swing.JButton(); ConfigurationCurrentMinerAlarmsScrollPane = new javax.swing.JScrollPane(); ConfigurationCurrentMinerAlarmsTextPane = new javax.swing.JTextPane(); ConfigurationCurrentMinerAlarmsLabel = new javax.swing.JLabel(); ConfigurationEligiusPoolsPanel = new javax.swing.JPanel(); ConfigurationEligiusLabel = new javax.swing.JLabel(); ConfigurationMiningPoolPromptLabel = new javax.swing.JLabel(); ConfigurationEligiusUsernameLabel = new javax.swing.JLabel(); ConfigurationEligiusUsernameTextField = new javax.swing.JTextField(); ConfigurationEligiusHelpPromptLabel = new javax.swing.JLabel(); ConfigurationEligiusUsernameAddButton = new javax.swing.JButton(); ConfigurationEligiusUsernameRemoveButton = new javax.swing.JButton(); ConfigurationEligiusExampleLabel = new javax.swing.JLabel(); ConfigurationCoinExchangePanel = new javax.swing.JPanel(); ConfigurationCoinbaseLabel = new javax.swing.JLabel(); ConfigurationCoinbaseCurrencyLabel = new javax.swing.JLabel(); ConfigurationCoinbaseCurrencyComboBox = new javax.swing.JComboBox(); CoinbaseConfigurationSeparator = new javax.swing.JSeparator(); CoinbaseInformationLabel = new javax.swing.JLabel(); CoinbaseUsernameLabel = new javax.swing.JLabel(); CoinbaseAPIUsernameTextField = new javax.swing.JTextField(); CoinbaseAPIKeyLabel = new javax.swing.JLabel(); CoinbaseAPIKeyTextField = new javax.swing.JTextField(); CoinbaseAPISecretKeyLabel = new javax.swing.JLabel(); CoinbaseAPISecretKeyTextField = new javax.swing.JTextField(); AddCoinbaseUsernameButton = new javax.swing.JButton(); RemoveCoinbaseUsernameButton = new javax.swing.JButton(); CurrentCoinbaseConfigurationLabel = new javax.swing.JLabel(); CoinbaseConfigurationSeparator1 = new javax.swing.JSeparator(); CurrentCoinbaseConfigurationScrollPane = new javax.swing.JScrollPane(); CurrentCoinbaseConfigurationTextPane = new javax.swing.JTextPane(); CoinbaseConfigurationVerticalSeparator = new javax.swing.JSeparator(); CoinbaseConfigurationInstructionsScrollPane = new javax.swing.JScrollPane(); CoinbaseConfigurationInstructionsTextPane = new javax.swing.JTextPane(); CoinbaseConfigurationInstructionsLabel = new javax.swing.JLabel(); BFGMInerUIMenuBar = new javax.swing.JMenuBar(); FileMenu = new javax.swing.JMenu(); FileExitMenuItem = new javax.swing.JMenuItem(); EditMenu = new javax.swing.JMenu("Edit"); CopyMenuItem = new javax.swing.JMenuItem(new DefaultEditorKit.CopyAction()); PasteMenuItem = new javax.swing.JMenuItem(new DefaultEditorKit.PasteAction()); HelpMenu = new javax.swing.JMenu(); AppHelpMenuItem = new javax.swing.JMenuItem(); AboutMenuItem = new javax.swing.JMenuItem(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("PlanetCrypto Bitcoin"); setBackground(new java.awt.Color(204, 255, 255)); MainTabbedPane.setToolTipText(""); MainTabbedPane.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N MainTabbedPane.setName(""); // NOI18N MinerInformationTabbedPane.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N ArrayList<String> miners = new ArrayList<>(); existing_miners = currentMiners(); //jComboBox1. if (existing_miners.get(0) == null) { miners.add("No Miners"); } else { for (int i = 0; i < existing_miners.size(); i++) { miners.add(existing_miners.get(i).get("name")); } } MinerSelectionBox.setModel(new javax.swing.DefaultComboBoxModel(miners.toArray())); MinerSelectionBox.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { MinerSelectionBoxActionPerformed(evt); } }); MinerSelectionBoxActionPerformed(null); MinerSelectionBoxLabel.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N MinerSelectionBoxLabel.setText("Current Miner:"); InformationMinerIPLabel.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N InformationMinerIPLabel.setText("Miner IP:"); /* if (existing_miners.get(MinerSelectionBox.getSelectedIndex()).get("name").equals("None")) { InformationMinerIPTextField.setText("None"); } else { InformationMinerIPTextField.setText(existing_miners.get(MinerSelectionBox.getSelectedIndex()).get("ip")); } */ InformationMinerIPTextField.setEditable(false); InformationMinerPortLabel.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N InformationMinerPortLabel.setText("Miner Port:"); InformationMinerPortTextField.setEditable(false); /* if (existing_miners.get(MinerSelectionBox.getSelectedIndex()) == null) { InformationMinerPortTextField.setText("None"); } else { InformationMinerPortTextField.setText(existing_miners.get(MinerSelectionBox.getSelectedIndex()).get("port")); } */ PrivilegedLabel.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N PrivilegedLabel.setText("Privileged: "); ASICsLabel.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N ASICsLabel.setText("ASICs:"); PrivilegedTextField.setEditable(false); /* if (existing_miners.get(MinerSelectionBox.getSelectedIndex()) ==null) { PrivilegedTextField.setText("None"); } else { String privileged = api_Commands.parseArgs(existing_miners.get(MinerSelectionBox.getSelectedIndex()).get("ip"), existing_miners.get(MinerSelectionBox.getSelectedIndex()).get("port"), "privileged"); String status = api_Commands.getKeys(privileged, "STATUS"); if (status.equals("E")) { PrivilegedTextField.setText("False"); } else { PrivilegedTextField.setText("True"); } } */ ASICsTextField.setEditable(false); PGAsLabel.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N PGAsLabel.setText("PGAs:"); PGAsTextField.setEditable(false); PoolCountLabel.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N PoolCountLabel.setText("Pool Count:"); PoolCountTextField.setEditable(false); MinerVersionLabel.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N MinerVersionLabel.setText("Version:"); MinerVersionTextField.setEditable(false); MinerStrategyLabel.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N MinerStrategyLabel.setText("Strategy:"); MinerStrategyTextField.setEditable(false); ACSChain1Label.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N ACSChain1Label.setText("ACS Chain 1:"); ACSChain1TextField.setEditable(false); ACSChain2Label.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N ACSChain2Label.setText("ACS Chain 2:"); ACSChain3Label.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N ACSChain3Label.setText("ACS Chain 3:"); ACSChain4Label.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N ACSChain4Label.setText("ACS Chain 4:"); ACSChain2TextField.setEditable(false); ACSChain3TextField.setEditable(false); ACSChain4TextField.setEditable(false); BytesSentLabel.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N BytesSentLabel.setText("Bytes Sent:"); BytesRecvLabel.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N BytesRecvLabel.setText("Bytes Recv:"); BytesSentTextField.setEditable(false); BytesRecvTextField.setEditable(false); HWErrorPercentLabel.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N HWErrorPercentLabel.setText("HW Error %:"); HWErrorPercentageTextField.setEditable(false); HWErrorsLabel.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N HWErrorsLabel.setText("HW Errors:"); HWErrorsTextField.setEditable(false); ACSChainInformationLabel.setText("For ACS chains: x = Not Well; o = Well"); MinerGenericInformationRefreshButton.setText("Refresh"); MinerGenericInformationRefreshButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { MinerGenericInformationRefreshButtonActionPerformed(evt); } }); javax.swing.GroupLayout InformationPanelLayout = new javax.swing.GroupLayout(InformationPanel); InformationPanel.setLayout(InformationPanelLayout); InformationPanelLayout.setHorizontalGroup(InformationPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(InformationPanelLayout.createSequentialGroup().addContainerGap() .addGroup(InformationPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(InformationPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(InformationPanelLayout.createSequentialGroup() .addComponent(ACSChainInformationLabel).addGap(51, 51, 51)) .addGroup(InformationPanelLayout.createSequentialGroup() .addGroup(InformationPanelLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(InformationPanelLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent(MinerSelectionBoxLabel) .addComponent(InformationMinerIPLabel) .addComponent(ASICsLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(PGAsLabel) .addComponent(PoolCountLabel) .addComponent(MinerVersionLabel)) .addComponent(PrivilegedLabel, javax.swing.GroupLayout.Alignment.LEADING)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(InformationPanelLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(ACSChain3TextField, javax.swing.GroupLayout.Alignment.LEADING) .addComponent(ACSChain2TextField, javax.swing.GroupLayout.Alignment.LEADING) .addComponent(ACSChain4TextField) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, InformationPanelLayout.createSequentialGroup() .addGroup(InformationPanelLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(MinerVersionTextField, javax.swing.GroupLayout.Alignment.LEADING) .addComponent( InformationMinerIPTextField, javax.swing.GroupLayout.Alignment.LEADING) .addComponent(PrivilegedTextField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 173, Short.MAX_VALUE) .addComponent(ASICsTextField, javax.swing.GroupLayout.Alignment.LEADING) .addComponent(PGAsTextField, javax.swing.GroupLayout.Alignment.LEADING) .addComponent(PoolCountTextField, javax.swing.GroupLayout.Alignment.LEADING) .addComponent(MinerSelectionBox, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(InformationPanelLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addGroup(InformationPanelLayout .createSequentialGroup() .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup( InformationPanelLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup( InformationPanelLayout .createSequentialGroup() .addGroup( InformationPanelLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent( BytesRecvLabel) .addComponent( HWErrorPercentLabel) .addComponent( HWErrorsLabel) .addComponent( MinerStrategyLabel)) .addGap(18, 18, 18) .addGroup( InformationPanelLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent( HWErrorsTextField, javax.swing.GroupLayout.Alignment.TRAILING) .addComponent( HWErrorPercentageTextField) .addComponent( BytesRecvTextField) .addComponent( MinerStrategyTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 172, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup( InformationPanelLayout .createSequentialGroup() .addGroup( InformationPanelLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent( InformationMinerPortLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 89, Short.MAX_VALUE) .addComponent( BytesSentLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(18, 18, 18) .addGroup( InformationPanelLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent( BytesSentTextField) .addComponent( InformationMinerPortTextField))))) .addGroup(InformationPanelLayout .createSequentialGroup() .addGap(31, 31, 31) .addComponent( MinerGenericInformationRefreshButton)))) .addComponent(ACSChain1TextField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 458, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(41, 41, 41))) .addComponent(ACSChain1Label).addComponent(ACSChain2Label) .addComponent(ACSChain3Label).addComponent(ACSChain4Label)))); InformationPanelLayout.setVerticalGroup(InformationPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(InformationPanelLayout.createSequentialGroup().addContainerGap() .addGroup(InformationPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(MinerSelectionBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(MinerSelectionBoxLabel) .addComponent(MinerGenericInformationRefreshButton)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(InformationPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(InformationMinerIPLabel) .addComponent(InformationMinerIPTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(InformationMinerPortLabel).addComponent(InformationMinerPortTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(InformationPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(PrivilegedLabel).addComponent(BytesSentLabel) .addComponent(BytesSentTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(PrivilegedTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(InformationPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(ASICsLabel) .addComponent(ASICsTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(BytesRecvLabel) .addComponent(BytesRecvTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(InformationPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(PGAsLabel) .addComponent(PGAsTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(HWErrorsLabel) .addComponent(HWErrorsTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(InformationPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(PoolCountLabel) .addComponent(PoolCountTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(HWErrorPercentLabel).addComponent(HWErrorPercentageTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(InformationPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(MinerVersionLabel) .addComponent(MinerVersionTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(MinerStrategyLabel).addComponent(MinerStrategyTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(InformationPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(ACSChain1Label).addComponent(ACSChain1TextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(InformationPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(ACSChain2Label).addComponent(ACSChain2TextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(InformationPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(ACSChain3Label).addComponent(ACSChain3TextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(InformationPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(ACSChain4Label).addComponent(ACSChain4TextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18).addComponent(ACSChainInformationLabel).addGap(41, 41, 41))); MinerInformationTabbedPane.addTab("Information", InformationPanel); MinerHashRatesPanel.add(MinerSelectionBox); HashRatesCurrentMiner.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N HashRatesCurrentMiner.setText("Current Miner:"); MinerCurrentHashLabel.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N MinerCurrentHashLabel.setText("Current Hash:"); MinerCurrentHashTextField.setEditable(false); MinerAverageHashLabel.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N MinerAverageHashLabel.setText("Average Hash:"); MinerAverageHashTextField.setEditable(false); MinerFoundBlocksLabel.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N MinerFoundBlocksLabel.setText("Found Blocks:"); MinerAcceptedLabel.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N MinerAcceptedLabel.setText("Accepted:"); MinerRejectedLabel.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N MinerRejectedLabel.setText("Rejected:"); MinerBestShareLabel.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N MinerBestShareLabel.setText("Best Share:"); MinerNetworkBlocksLabel.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N MinerNetworkBlocksLabel.setText("Network Blocks:"); MinerFoundBlocksTextField.setEditable(false); MinerAcceptedTextField.setEditable(false); MinerRejectedTextField.setEditable(false); MinerBestShareTextField.setEditable(false); MinerNetworkBlocksTextField.setEditable(false); MinerSelectionBox1.setModel(new javax.swing.DefaultComboBoxModel(miners.toArray())); org.jdesktop.beansbinding.Binding binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, MinerSelectionBox, org.jdesktop.beansbinding.ELProperty.create("${selectedItem}"), MinerSelectionBox1, org.jdesktop.beansbinding.BeanProperty.create("selectedItem")); bindingGroup.addBinding(binding); MinerHashRatesRefreshButton.setText("Refresh"); MinerHashRatesRefreshButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { MinerHashRatesRefreshButtonActionPerformed(evt); } }); javax.swing.GroupLayout MinerHashRatesPanelLayout = new javax.swing.GroupLayout(MinerHashRatesPanel); MinerHashRatesPanel.setLayout(MinerHashRatesPanelLayout); MinerHashRatesPanelLayout.setHorizontalGroup(MinerHashRatesPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(MinerHashRatesPanelLayout.createSequentialGroup().addContainerGap() .addGroup(MinerHashRatesPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(HashRatesCurrentMiner).addComponent(MinerCurrentHashLabel) .addComponent(MinerAverageHashLabel).addComponent(MinerFoundBlocksLabel) .addComponent(MinerAcceptedLabel).addComponent(MinerRejectedLabel) .addComponent(MinerBestShareLabel).addComponent(MinerNetworkBlocksLabel)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(MinerHashRatesPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(MinerHashRatesPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(MinerCurrentHashTextField) .addComponent(MinerAverageHashTextField) .addComponent(MinerFoundBlocksTextField) .addComponent(MinerAcceptedTextField).addComponent(MinerRejectedTextField) .addComponent(MinerBestShareTextField) .addComponent(MinerNetworkBlocksTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE)) .addGroup(MinerHashRatesPanelLayout.createSequentialGroup() .addComponent(MinerSelectionBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 173, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(MinerHashRatesRefreshButton))) .addContainerGap(440, Short.MAX_VALUE))); MinerHashRatesPanelLayout.setVerticalGroup(MinerHashRatesPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(MinerHashRatesPanelLayout.createSequentialGroup().addContainerGap() .addGroup(MinerHashRatesPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(HashRatesCurrentMiner) .addComponent(MinerSelectionBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(MinerHashRatesRefreshButton)) .addGap(21, 21, 21) .addGroup(MinerHashRatesPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(MinerCurrentHashLabel).addComponent(MinerCurrentHashTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(MinerHashRatesPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(MinerAverageHashLabel).addComponent(MinerAverageHashTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(MinerHashRatesPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(MinerFoundBlocksLabel).addComponent(MinerFoundBlocksTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(MinerHashRatesPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(MinerAcceptedLabel).addComponent(MinerAcceptedTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(MinerHashRatesPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(MinerRejectedLabel).addComponent(MinerRejectedTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(MinerHashRatesPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(MinerBestShareLabel).addComponent(MinerBestShareTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(MinerHashRatesPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(MinerNetworkBlocksLabel).addComponent(MinerNetworkBlocksTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); MinerInformationTabbedPane.addTab("Hash Rates", MinerHashRatesPanel); TemperatureCurrentMinerLabel.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N TemperatureCurrentMinerLabel.setText("Current Miner:"); MinerTemp1Label.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N MinerTemp1Label.setText("Temp 1:"); MinerTemp2Label.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N MinerTemp2Label.setText("Temp 2:"); MinerTemp3Label.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N MinerTemp3Label.setText("Temp 3:"); MinerTemp4Label.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N MinerTemp4Label.setText("Temp 4:"); MinerTempAvgLabel.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N MinerTempAvgLabel.setText("Temp Avg:"); MinerTempMaxLabel.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N MinerTempMaxLabel.setText("Temp Max"); MinerTemp1TextField.setEditable(false); MinerTemp2TextField.setEditable(false); MinerTemp3TextField.setEditable(false); MinerTemp4TextField.setEditable(false); MinerTempAvgTextField.setEditable(false); MinerTextMaxTextField.setEditable(false); MinerSelectionBox2.setModel(new javax.swing.DefaultComboBoxModel(miners.toArray())); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, MinerSelectionBox1, org.jdesktop.beansbinding.ELProperty.create("${selectedItem}"), MinerSelectionBox2, org.jdesktop.beansbinding.BeanProperty.create("selectedItem")); bindingGroup.addBinding(binding); MinerTemperaturesRefreshButton.setText("Refresh"); MinerTemperaturesRefreshButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { MinerTemperaturesRefreshButtonActionPerformed(evt); } }); javax.swing.GroupLayout MinerTemperaturePanelLayout = new javax.swing.GroupLayout(MinerTemperaturePanel); MinerTemperaturePanel.setLayout(MinerTemperaturePanelLayout); MinerTemperaturePanelLayout.setHorizontalGroup(MinerTemperaturePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(MinerTemperaturePanelLayout.createSequentialGroup().addContainerGap() .addGroup(MinerTemperaturePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(TemperatureCurrentMinerLabel).addComponent(MinerTemp1Label) .addComponent(MinerTemp2Label).addComponent(MinerTemp3Label) .addComponent(MinerTemp4Label).addComponent(MinerTempAvgLabel) .addComponent(MinerTempMaxLabel)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(MinerTemperaturePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(MinerTemperaturePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(MinerTemp1TextField).addComponent(MinerTemp2TextField) .addComponent(MinerTemp3TextField).addComponent(MinerTemp4TextField) .addComponent(MinerTempAvgTextField).addComponent(MinerTextMaxTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE)) .addGroup(MinerTemperaturePanelLayout.createSequentialGroup() .addComponent(MinerSelectionBox2, javax.swing.GroupLayout.PREFERRED_SIZE, 173, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(MinerTemperaturesRefreshButton))) .addContainerGap(448, Short.MAX_VALUE))); MinerTemperaturePanelLayout.setVerticalGroup( MinerTemperaturePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(MinerTemperaturePanelLayout.createSequentialGroup().addContainerGap() .addGroup(MinerTemperaturePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(TemperatureCurrentMinerLabel) .addComponent(MinerSelectionBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(MinerTemperaturesRefreshButton)) .addGap(21, 21, 21) .addGroup(MinerTemperaturePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(MinerTemp1Label).addComponent(MinerTemp1TextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(MinerTemperaturePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(MinerTemp2Label).addComponent(MinerTemp2TextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(MinerTemperaturePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(MinerTemp3Label).addComponent(MinerTemp3TextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(MinerTemperaturePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(MinerTemp4Label).addComponent(MinerTemp4TextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(MinerTemperaturePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(MinerTempAvgLabel).addComponent(MinerTempAvgTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(MinerTemperaturePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(MinerTempMaxLabel).addComponent(MinerTextMaxTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); MinerInformationTabbedPane.addTab("Temperatures", MinerTemperaturePanel); FansCurrentMinerLabel.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N FansCurrentMinerLabel.setText("Current Miner:"); MinerFan1Label.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N MinerFan1Label.setText("Fan 1:"); MinerFan2Label.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N MinerFan2Label.setText("Fan 2:"); MinerFan3Label.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N MinerFan3Label.setText("Fan 3:"); MinerFan4Label.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N MinerFan4Label.setText("Fan 4:"); MinerFan1TextField.setEditable(false); MinerFan2TextField.setEditable(false); MinerFan3TextField.setEditable(false); MinerFan4TextField.setEditable(false); MinerSelectionBox3.setModel(new javax.swing.DefaultComboBoxModel(miners.toArray())); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, MinerSelectionBox2, org.jdesktop.beansbinding.ELProperty.create("${selectedItem}"), MinerSelectionBox3, org.jdesktop.beansbinding.BeanProperty.create("selectedItem")); bindingGroup.addBinding(binding); MinerFanSpeedsRefreshButton.setText("Refresh"); MinerFanSpeedsRefreshButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { MinerFanSpeedsRefreshButtonActionPerformed(evt); } }); javax.swing.GroupLayout MinerFansPanelLayout = new javax.swing.GroupLayout(MinerFansPanel); MinerFansPanel.setLayout(MinerFansPanelLayout); MinerFansPanelLayout.setHorizontalGroup(MinerFansPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(MinerFansPanelLayout.createSequentialGroup().addContainerGap() .addGroup(MinerFansPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(MinerFansPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(MinerFan3Label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(MinerFan2Label, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(MinerFan1Label, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(MinerFan4Label, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 103, Short.MAX_VALUE)) .addComponent(FansCurrentMinerLabel)) .addGap(18, 18, 18) .addGroup(MinerFansPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(MinerFansPanelLayout.createSequentialGroup() .addComponent(MinerSelectionBox3, javax.swing.GroupLayout.PREFERRED_SIZE, 173, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(MinerFanSpeedsRefreshButton)) .addGroup(MinerFansPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(MinerFan4TextField, javax.swing.GroupLayout.Alignment.LEADING) .addComponent(MinerFan3TextField, javax.swing.GroupLayout.Alignment.LEADING) .addComponent(MinerFan2TextField, javax.swing.GroupLayout.Alignment.LEADING) .addComponent(MinerFan1TextField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE))) .addContainerGap(442, Short.MAX_VALUE))); MinerFansPanelLayout.setVerticalGroup( MinerFansPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(MinerFansPanelLayout.createSequentialGroup().addContainerGap() .addGroup(MinerFansPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(FansCurrentMinerLabel) .addComponent(MinerSelectionBox3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(MinerFanSpeedsRefreshButton)) .addGap(21, 21, 21) .addGroup(MinerFansPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(MinerFan1Label) .addComponent(MinerFan1TextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(MinerFansPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(MinerFan2TextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(MinerFan2Label)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(MinerFansPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(MinerFan3Label).addComponent(MinerFan3TextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(MinerFansPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(MinerFan4Label).addComponent(MinerFan4TextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); MinerInformationTabbedPane.addTab("Fans", MinerFansPanel); CustomAPICommandCurrentMiner.setText("Current Miner:"); CustomCommandEntryLabel.setText("Enter Custom Command:"); CustomCommandOutputTextArea.setEditable(false); CustomCommandOutputTextArea.setColumns(20); CustomCommandOutputTextArea.setRows(5); CustomCommandOutputScrollPane.setViewportView(CustomCommandOutputTextArea); CustomCommandOutputLabel.setText("Output:"); CustomCommandSubmitButton.setText("Submit"); CustomCommandSubmitButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { CustomCommandSubmitButtonActionPerformed(evt); } }); CustomCommandJsonCheckBox.setText("Check for JSON Output"); CustomCommandJsonCheckBox.addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { CustomCommandJsonCheckBoxKeyPressed(evt); } }); CustomCommandMinerSelectionBox.setModel(new javax.swing.DefaultComboBoxModel(miners.toArray())); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, MinerSelectionBox3, org.jdesktop.beansbinding.ELProperty.create("${selectedItem}"), CustomCommandMinerSelectionBox, org.jdesktop.beansbinding.BeanProperty.create("selectedItem")); bindingGroup.addBinding(binding); javax.swing.GroupLayout CustomAPICommandPanelLayout = new javax.swing.GroupLayout(CustomAPICommandPanel); CustomAPICommandPanel.setLayout(CustomAPICommandPanelLayout); CustomAPICommandPanelLayout.setHorizontalGroup(CustomAPICommandPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(CustomAPICommandPanelLayout.createSequentialGroup().addGap(22, 22, 22) .addGroup(CustomAPICommandPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(CustomCommandOutputScrollPane).addComponent(CustomCommandOutputLabel) .addGroup(CustomAPICommandPanelLayout.createSequentialGroup() .addComponent(CustomCommandEntryLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(CustomCommandEntryTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18).addComponent(CustomCommandJsonCheckBox) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(CustomCommandSubmitButton)) .addGroup(CustomAPICommandPanelLayout.createSequentialGroup() .addComponent(CustomAPICommandCurrentMiner) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(CustomCommandMinerSelectionBox, javax.swing.GroupLayout.PREFERRED_SIZE, 173, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); CustomAPICommandPanelLayout.setVerticalGroup(CustomAPICommandPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(CustomAPICommandPanelLayout.createSequentialGroup().addContainerGap() .addGroup(CustomAPICommandPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(CustomAPICommandCurrentMiner).addComponent( CustomCommandMinerSelectionBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(20, 20, 20) .addGroup(CustomAPICommandPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(CustomCommandEntryLabel) .addComponent(CustomCommandEntryTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(CustomCommandSubmitButton).addComponent(CustomCommandJsonCheckBox)) .addGap(18, 18, 18).addComponent(CustomCommandOutputLabel).addGap(7, 7, 7) .addComponent(CustomCommandOutputScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 234, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); MinerInformationTabbedPane.addTab("Custom Command", CustomAPICommandPanel); //System.out.println(existing_miners.toString()); MinerVitalStatsTextPane.setContentType("text/html"); MinerVitalStatsTextPane.setEditable(false); MinerVitalStatsTextPane.addPropertyChangeListener(new java.beans.PropertyChangeListener() { public void propertyChange(java.beans.PropertyChangeEvent evt) { MinerVitalStatsTextPanePropertyChange(evt); } }); jScrollPane2.setViewportView(MinerVitalStatsTextPane); jLabel1.setFont(new java.awt.Font("DejaVu Sans", 3, 14)); // NOI18N jLabel1.setText("Vital Miner Statistics"); VitalStatsRefreshButton.setText("Refresh"); VitalStatsRefreshButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { VitalStatsRefreshButtonActionPerformed(evt); } }); javax.swing.GroupLayout MinerVitalsPanelLayout = new javax.swing.GroupLayout(MinerVitalsPanel); MinerVitalsPanel.setLayout(MinerVitalsPanelLayout); MinerVitalsPanelLayout.setHorizontalGroup( MinerVitalsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(MinerVitalsPanelLayout.createSequentialGroup().addContainerGap() .addGroup(MinerVitalsPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(MinerVitalsPanelLayout.createSequentialGroup() .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 645, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(VitalStatsRefreshButton)) .addComponent(jLabel1)) .addContainerGap(93, Short.MAX_VALUE))); MinerVitalsPanelLayout.setVerticalGroup(MinerVitalsPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(MinerVitalsPanelLayout.createSequentialGroup().addGap(16, 16, 16).addComponent(jLabel1) .addGap(18, 18, 18) .addGroup(MinerVitalsPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 306, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(VitalStatsRefreshButton)) .addContainerGap(229, Short.MAX_VALUE))); MinerInformationTabbedPane.addTab("Vitals", MinerVitalsPanel); javax.swing.GroupLayout MinerInformationPanelLayout = new javax.swing.GroupLayout(MinerInformationPanel); MinerInformationPanel.setLayout(MinerInformationPanelLayout); MinerInformationPanelLayout.setHorizontalGroup( MinerInformationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(MinerInformationTabbedPane)); MinerInformationPanelLayout.setVerticalGroup( MinerInformationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(MinerInformationPanelLayout.createSequentialGroup().addContainerGap() .addComponent(MinerInformationTabbedPane, javax.swing.GroupLayout.PREFERRED_SIZE, 615, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); MainTabbedPane.addTab("Miners", MinerInformationPanel); BTCConversionRateLabel.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N BTCConversionRateLabel.setText("BTC Conversion Rate:"); NetworkDifficultyLabel.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N NetworkDifficultyLabel.setText("Network Difficulty:"); EstimatedPayoutLabel.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N EstimatedPayoutLabel.setText("Estimated Payout:"); NetworkDifficultyTextField.setEditable(false); BTCConversionRateTextField.setEditable(false); BTCConversionRateTextField.setText("Not configured yet"); EstimatedPayoutTextField.setEditable(false); CurrentBlockHashLabel.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N CurrentBlockHashLabel.setText("Current Block Hash:"); CurrentBlockHashTextField.setEditable(false); CurrentBlockTimeLabel.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N CurrentBlockTimeLabel.setText("Current Block Time:"); CurrentBlockTimeTextField.setEditable(false); GenericInformationCurrentMinerLabel.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N GenericInformationCurrentMinerLabel.setText("Current Miner:"); MinerSelectionBox5.setModel(new javax.swing.DefaultComboBoxModel(miners.toArray())); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, CustomCommandMinerSelectionBox, org.jdesktop.beansbinding.ELProperty.create("${selectedItem}"), MinerSelectionBox5, org.jdesktop.beansbinding.BeanProperty.create("selectedItem")); bindingGroup.addBinding(binding); BitcoinInformationRefreshButton.setText("Refresh"); BitcoinInformationRefreshButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { BitcoinInformationRefreshButtonActionPerformed(evt); } }); GenericInformationCoinbaseUserLabel.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N GenericInformationCoinbaseUserLabel.setText("Current Coinbase User:"); existing_coinbase = currentCoinbase(); ; ArrayList<String> coinbase_users = new ArrayList<>(); if (existing_coinbase == null) { coinbase_users.add("No Users"); } else { for (int i = 0; i < existing_coinbase.size(); i++) { coinbase_users.add(existing_coinbase.get(i).get("email")); } } GenericInformationCoinbaseUserSelectionBox .setModel(new javax.swing.DefaultComboBoxModel(coinbase_users.toArray())); GenericInformationCoinbaseUserSelectionBox.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { GenericInformationCoinbaseUserSelectionBoxActionPerformed(evt); } }); GenericInformationAbbreviatedPreferredCurrencyLabel.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N GenericInformationAbbreviatedPreferredCurrencyLabel .addPropertyChangeListener(new java.beans.PropertyChangeListener() { public void propertyChange(java.beans.PropertyChangeEvent evt) { GenericInformationAbbreviatedPreferredCurrencyLabelPropertyChange(evt); } }); GenericInformationAbbreviatedPreferredCurrencyLabel2.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, GenericInformationAbbreviatedPreferredCurrencyLabel, org.jdesktop.beansbinding.ELProperty.create("${text}"), GenericInformationAbbreviatedPreferredCurrencyLabel2, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); javax.swing.GroupLayout BTCGenericInformationPanelLayout = new javax.swing.GroupLayout( BTCGenericInformationPanel); BTCGenericInformationPanel.setLayout(BTCGenericInformationPanelLayout); BTCGenericInformationPanelLayout.setHorizontalGroup(BTCGenericInformationPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(BTCGenericInformationPanelLayout.createSequentialGroup().addContainerGap() .addGroup(BTCGenericInformationPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(EstimatedPayoutLabel).addComponent(BTCConversionRateLabel) .addComponent(NetworkDifficultyLabel).addComponent(CurrentBlockHashLabel) .addComponent(GenericInformationCurrentMinerLabel) .addComponent(CurrentBlockTimeLabel) .addComponent(GenericInformationCoinbaseUserLabel)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(BTCGenericInformationPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(BTCGenericInformationPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(CurrentBlockHashTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 559, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(BTCGenericInformationPanelLayout.createSequentialGroup() .addComponent(MinerSelectionBox5, javax.swing.GroupLayout.PREFERRED_SIZE, 173, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(BitcoinInformationRefreshButton)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, BTCGenericInformationPanelLayout.createSequentialGroup() .addGroup(BTCGenericInformationPanelLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(EstimatedPayoutTextField, javax.swing.GroupLayout.Alignment.LEADING) .addComponent(BTCConversionRateTextField)) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(BTCGenericInformationPanelLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent( GenericInformationAbbreviatedPreferredCurrencyLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent( GenericInformationAbbreviatedPreferredCurrencyLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 89, Short.MAX_VALUE)) .addGap(184, 184, 184)) .addComponent(NetworkDifficultyTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 280, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(CurrentBlockTimeTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 280, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(GenericInformationCoinbaseUserSelectionBox, javax.swing.GroupLayout.PREFERRED_SIZE, 255, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap())); BTCGenericInformationPanelLayout.setVerticalGroup(BTCGenericInformationPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(BTCGenericInformationPanelLayout.createSequentialGroup().addGap(3, 3, 3) .addGroup(BTCGenericInformationPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(GenericInformationCurrentMinerLabel) .addComponent(MinerSelectionBox5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(BitcoinInformationRefreshButton)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(BTCGenericInformationPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(GenericInformationCoinbaseUserLabel) .addComponent(GenericInformationCoinbaseUserSelectionBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(7, 7, 7) .addGroup(BTCGenericInformationPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(NetworkDifficultyTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(NetworkDifficultyLabel)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(BTCGenericInformationPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(CurrentBlockHashTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(CurrentBlockHashLabel)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(BTCGenericInformationPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(CurrentBlockTimeTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(CurrentBlockTimeLabel)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(BTCGenericInformationPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(BTCConversionRateTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(BTCConversionRateLabel) .addComponent(GenericInformationAbbreviatedPreferredCurrencyLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(BTCGenericInformationPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(GenericInformationAbbreviatedPreferredCurrencyLabel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(BTCGenericInformationPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(EstimatedPayoutLabel).addComponent(EstimatedPayoutTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(372, 372, 372))); BitcoinInformationTabbedPane.addTab("Generic Information", BTCGenericInformationPanel); CoinbaseAPILabel.setFont(new java.awt.Font("DejaVu Serif", 3, 14)); // NOI18N CoinbaseAPILabel.setText("Buy, Sell, Trade BTC Here"); CoinbaseAPICurrentUserLabel.setText("Current Coinbase User"); CoinbaseAPIUserSelectionBox.setModel(new javax.swing.DefaultComboBoxModel(existingCoinbase().toArray())); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, GenericInformationCoinbaseUserSelectionBox, org.jdesktop.beansbinding.ELProperty.create("${selectedItem}"), CoinbaseAPIUserSelectionBox, org.jdesktop.beansbinding.BeanProperty.create("selectedItem")); bindingGroup.addBinding(binding); javax.swing.GroupLayout CoinbaseAPIPanelLayout = new javax.swing.GroupLayout(CoinbaseAPIPanel); CoinbaseAPIPanel.setLayout(CoinbaseAPIPanelLayout); CoinbaseAPIPanelLayout.setHorizontalGroup( CoinbaseAPIPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(CoinbaseAPIPanelLayout.createSequentialGroup().addContainerGap() .addGroup(CoinbaseAPIPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(CoinbaseAPILabel, javax.swing.GroupLayout.PREFERRED_SIZE, 351, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(CoinbaseAPIPanelLayout.createSequentialGroup() .addComponent(CoinbaseAPICurrentUserLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(CoinbaseAPIUserSelectionBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) .addContainerGap(469, Short.MAX_VALUE))); CoinbaseAPIPanelLayout.setVerticalGroup(CoinbaseAPIPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(CoinbaseAPIPanelLayout.createSequentialGroup().addGap(18, 18, 18) .addComponent(CoinbaseAPILabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(CoinbaseAPIPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(CoinbaseAPICurrentUserLabel).addComponent(CoinbaseAPIUserSelectionBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(526, Short.MAX_VALUE))); BitcoinInformationTabbedPane.addTab("Coinbase API", CoinbaseAPIPanel); EligiusStatusLabel.setFont(new java.awt.Font("DejaVu Serif", 3, 14)); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, EligiusUsernameSelectionBox, org.jdesktop.beansbinding.ELProperty.create("${selectedItem}"), EligiusStatusLabel, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); /* org.planetcrypto.bitcoin.PlanetCryptoNetworkMethods parser = new org.planetcrypto.bitcoin.PlanetCryptoNetworkMethods(); ArrayList<String> eligius_names = cfg.getEligius(); //System.out.println(eligius_names); EligiusUsernameSelectionBox.setModel(new javax.swing.DefaultComboBoxModel(eligius_names.toArray())); String eligius_name = EligiusUsernameSelectionBox.getSelectedItem().toString(); if (eligius_name.startsWith("Eligius not configured")) { EligiusHashRateInformationTable.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {"12 Hours", null, null}, {"3 Hours", null, null}, {"22.5 Minutes", null, null}, {"256 Seconds", null, null}, {"128 Seconds", null, null} }, new String [] { "Interval", "Hashrate", "Weighted Shares" } ) { Class[] types = new Class [] { java.lang.String.class, java.lang.String.class, java.lang.Integer.class }; boolean[] canEdit = new boolean [] { false, false, false }; public Class getColumnClass(int columnIndex) { return types [columnIndex]; } public boolean isCellEditable(int rowIndex, int columnIndex) { return canEdit [columnIndex]; } }); } else { String hashrates = parser.getHashRate("&username=" + eligius_name); EligiusHashRateInformationTable.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {"12 Hours", parser.getHashRateIntervals(hashrates, "av43200").get(0), parser.getHashRateIntervals(hashrates, "av43200").get(1)}, {"3 Hours", parser.getHashRateIntervals(hashrates, "av10800").get(0), parser.getHashRateIntervals(hashrates, "av10800").get(1)}, {"22.5 Minutes", parser.getHashRateIntervals(hashrates, "av1350").get(0), parser.getHashRateIntervals(hashrates, "av1350").get(1)}, {"256 Seconds", parser.getHashRateIntervals(hashrates, "av256").get(0), parser.getHashRateIntervals(hashrates, "av256").get(1)}, {"128 Seconds", parser.getHashRateIntervals(hashrates, "av128").get(0), parser.getHashRateIntervals(hashrates, "av128").get(1)} }, new String [] { "Interval", "Hashrate", "Weighted Shares" } ) { Class[] types = new Class [] { java.lang.String.class, java.lang.String.class, java.lang.Integer.class }; boolean[] canEdit = new boolean [] { false, false, false }; public Class getColumnClass(int columnIndex) { return types [columnIndex]; } public boolean isCellEditable(int rowIndex, int columnIndex) { return canEdit [columnIndex]; } }); } cfg.closeAll(); EligiusHashRateInformationScrollPane.setViewportView(EligiusHashRateInformationTable); */ EligiusPoolInformationRefreshButtonActionPerformed(null); /* Thread t = new Thread(new Runnable() { @Override public void run() { eligius_name = EligiusUsernameSelectionBox.getSelectedItem().toString(); if (eligius_name.startsWith("Eligius not configured")) { EligiusPayoutInformationTable.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {"bal", null}, {"ec", null}, {"everpaid", null}, {"lbal", null}, {"lec", null} }, new String [] { "", "Amount" } ) { Class[] types = new Class [] { java.lang.String.class, java.lang.String.class, java.lang.Integer.class }; boolean[] canEdit = new boolean [] { false, false, false }; public Class getColumnClass(int columnIndex) { return types [columnIndex]; } public boolean isCellEditable(int rowIndex, int columnIndex) { return canEdit [columnIndex]; }} ); } else { String stats = parser.getUserStat("&username=" + eligius_name); EligiusPayoutInformationTable.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {"bal", parser.getUserStats(stats, "bal")}, {"ec", parser.getUserStats(stats, "ec")}, {"everpaid", parser.getUserStats(stats, "everpaid")}, {"lbal", parser.getUserStats(stats, "lbal")}, {"lec", parser.getUserStats(stats, "lec")} }, new String [] { "", "Amount" } ) { Class[] types = new Class [] { java.lang.String.class, java.lang.String.class, java.lang.Integer.class }; boolean[] canEdit = new boolean [] { false, false, false }; public Class getColumnClass(int columnIndex) { return types [columnIndex]; } public boolean isCellEditable(int rowIndex, int columnIndex) { return canEdit [columnIndex]; }} ); BFGMinerAPICoinbase coinbase = new BFGMinerAPICoinbase(); String rate = coinbase.getContent("https://coinbase.com/api/v1/currencies/exchange_rates", "btc_to_usd"); String payout = EligiusPayoutInformationTable.getValueAt(0, 1).toString().replace(" BTC", ""); BTCConversionRateTextField.setText(rate); EstimatedPayoutTextField.setText(String.valueOf(Float.parseFloat(rate)* Float.parseFloat(payout))); } //BFGMinerAPICoinbase coinbase = new BFGMinerAPICoinbase(); //BTCConversionRateTextField.setText(coinbase.getContent("https://coinbase.com/api/v1/currencies/exchange_rates", "btc_to_usd")); //if (EligiusPayoutInformationTable.getValueAt(0, 1) != null) { // System.out.println(EligiusPayoutInformationTable.getValueAt(0, 1).toString()); //} else { // System.out.println("No Value yet"); //} EligiusPayoutInformationTable.addPropertyChangeListener(new java.beans.PropertyChangeListener() { public void propertyChange(java.beans.PropertyChangeEvent evt) { EligiusPayoutInformationTablePropertyChange(evt); } }); EligiusPayoutInformationPayoutScrollPane.setViewportView(EligiusPayoutInformationTable); } }); t.start(); */ //EligiusPayoutInformationTableAncestorRemoved(null); EligiusPoolInformationRefreshButton.setText("Refresh"); EligiusPoolInformationRefreshButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { EligiusPoolInformationRefreshButtonActionPerformed(evt); } }); EligiousPayoutKeyInformationTextPane.setFont(new Font("Dialog", Font.PLAIN, 14)); EligiousPayoutKeyInformationTextPane.setContentType("text/html"); EligiousPayoutKeyInformationTextPane.setText( "<html><ul><li><em><b>bal</b></em> - Current unpaid balance including estimates for the current round</li>" + "<li><em><b>ec</b></em> - Sum of CPPSRB shelved shares and SMPPS extra credit (if applicable) including estimates for the current round</li>" + "<li><em><b>everpaid</b></em> - Total actually paid (and verifyable in the blockchain) to this miner</li>" + "<li><em><b>lbal</b></em> - Unpaid balance as of the last block (no estimates)</li>" + "<li><em><b>lec</b></em> - Sum of CPPSRB shelved shares and SMPPS extra credit (if applicable) as of the last block (no estimates)</li></ul></html>"); EligiousPayoutKeyInformationTextPane.setEditable(false); EligiusPayoutKeyInformationScrollPane.setViewportView(EligiousPayoutKeyInformationTextPane); existing_eligius = currentEligius(); EligiusUsernameSelectionBox.setModel(new javax.swing.DefaultComboBoxModel(existing_eligius.toArray())); EligiusUsernameSelectionBox.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { EligiusUsernameSelectionBoxActionPerformed(evt); } }); EligiusUsernameClipboardCopyButton.setText("Copy To Clipboard"); EligiusUsernameClipboardCopyButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { EligiusUsernameClipboardCopyButtonActionPerformed(evt); } }); EligiusPoolCurrentUsernameLabel.setFont(new java.awt.Font("DejaVu Serif", 3, 12)); // NOI18N EligiusPoolCurrentUsernameLabel.setText("Eligius Username:"); EligiusOpenBrowserButton.setText("Open Eligius in Browser"); EligiusOpenBrowserButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { EligiusOpenBrowserButtonActionPerformed(evt); } }); javax.swing.GroupLayout EligiusPoolInformationPanelLayout = new javax.swing.GroupLayout( EligiusPoolInformationPanel); EligiusPoolInformationPanel.setLayout(EligiusPoolInformationPanelLayout); EligiusPoolInformationPanelLayout.setHorizontalGroup(EligiusPoolInformationPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(EligiusPoolInformationPanelLayout.createSequentialGroup().addContainerGap() .addGroup(EligiusPoolInformationPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(EligiusPayoutKeyInformationScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 695, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(EligiusPoolInformationPanelLayout.createSequentialGroup() .addComponent(EligiusPayoutInformationPayoutScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(EligiusPoolInformationRefreshButton)) .addComponent(EligiusHashRateInformationScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(EligiusPoolInformationPanelLayout.createSequentialGroup() .addGroup(EligiusPoolInformationPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(EligiusPoolInformationPanelLayout.createSequentialGroup() .addComponent(EligiusStatusLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 408, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(EligiusUsernameClipboardCopyButton)) .addGroup(EligiusPoolInformationPanelLayout.createSequentialGroup() .addComponent(EligiusPoolCurrentUsernameLabel) .addGap(3, 3, 3).addComponent(EligiusUsernameSelectionBox, javax.swing.GroupLayout.PREFERRED_SIZE, 459, javax.swing.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(EligiusOpenBrowserButton))) .addGap(14, 14, 14))); EligiusPoolInformationPanelLayout.setVerticalGroup(EligiusPoolInformationPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(EligiusPoolInformationPanelLayout.createSequentialGroup().addGap(13, 13, 13) .addGroup(EligiusPoolInformationPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(EligiusUsernameSelectionBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(EligiusPoolCurrentUsernameLabel)) .addGap(16, 16, 16) .addGroup(EligiusPoolInformationPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(EligiusStatusLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(EligiusUsernameClipboardCopyButton) .addComponent(EligiusOpenBrowserButton)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(EligiusHashRateInformationScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addGroup(EligiusPoolInformationPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(EligiusPayoutInformationPayoutScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(EligiusPoolInformationRefreshButton)) .addGap(18, 18, 18).addComponent(EligiusPayoutKeyInformationScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 159, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap())); BitcoinInformationTabbedPane.addTab("Pool Information", EligiusPoolInformationPanel); javax.swing.GroupLayout BTCInformationPaneLayout = new javax.swing.GroupLayout(BTCInformationPane); BTCInformationPane.setLayout(BTCInformationPaneLayout); BTCInformationPaneLayout.setHorizontalGroup( BTCInformationPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(BitcoinInformationTabbedPane)); BTCInformationPaneLayout.setVerticalGroup( BTCInformationPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(BitcoinInformationTabbedPane)); MainTabbedPane.addTab("Bitcoin Information", BTCInformationPane); MinerConfigurationPanel.addFocusListener(new java.awt.event.FocusAdapter() { public void focusGained(java.awt.event.FocusEvent evt) { MinerConfigurationPanelFocusGained(evt); } }); ConfigurationPromptLabel.setFont(new java.awt.Font("DejaVu Serif", 3, 14)); // NOI18N ConfigurationPromptLabel .setText("Please fill in the following form to configure this interface. Changes are persistent."); ConfigurationRemoveMinerButton.setText("Remove Miner"); ConfigurationRemoveMinerButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { ConfigurationRemoveMinerButtonActionPerformed(evt); } }); ConfigurationAddMinerButton.setText("Add Miner"); ConfigurationAddMinerButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { ConfigurationAddMinerButtonActionPerformed(evt); } }); ConfigurationAddMinerNameLabel.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N ConfigurationAddMinerNameLabel.setText("Miner Name:"); ConfigurationAddMinerIPLabel.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N ConfigurationAddMinerIPLabel.setText("Miner IP:"); ConfigurationMinerPortLabel.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N ConfigurationMinerPortLabel.setText("Miner Port:"); ConfigurationAddMinersLabel.setFont(new java.awt.Font("DejaVu Serif", 3, 14)); // NOI18N ConfigurationAddMinersLabel.setText("Add Miners"); ConfigurationRemoveMinersLabel.setFont(new java.awt.Font("DejaVu Serif", 3, 14)); // NOI18N ConfigurationRemoveMinersLabel.setText("Remove Miners"); ConfigurationRemoveMinerNameLabel.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N ConfigurationRemoveMinerNameLabel.setText("Miner Name:"); ConfigurationCurrentMinersLabel.setFont(new java.awt.Font("DejaVu Serif", 3, 14)); // NOI18N ConfigurationCurrentMinersLabel.setText("Current Miners:"); ConfigurationRemoveMinerIPLabel.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N ConfigurationRemoveMinerIPLabel.setText("or Miner IP:"); ConfigurationResolveHostAddressLabel.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N ConfigurationResolveHostAddressLabel.setText("Resolve host address:"); ConfigurationResolveHostAddressButton.setText("Get IP"); ConfigurationResolveHostAddressButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { ConfigurationResolveHostAddressButtonActionPerformed(evt); } }); ConfigurationCurrentMinersTextPane.setEditable(false); ConfigurationCurrentMinersTextPane.setFont(new Font("Monospaced", 0, 12)); // NOI18N ConfigurationCurrentMinersTextPane.setContentType("text/html"); org.planetcrypto.bitcoin.PlanetCryptoBitcoinUserConfiguration current_miners_configuration = new org.planetcrypto.bitcoin.PlanetCryptoBitcoinUserConfiguration(); ConfigurationCurrentMinersTextPane.setText(current_miners_configuration.currentMiners()); current_miners_configuration.closeAll(); ConfigurationCurrentMinersTextPane.setEditable(false); ConfigurationCurrentMinersScrollPane.setViewportView(ConfigurationCurrentMinersTextPane); javax.swing.GroupLayout MinerConfigurationPanelLayout = new javax.swing.GroupLayout( MinerConfigurationPanel); MinerConfigurationPanel.setLayout(MinerConfigurationPanelLayout); MinerConfigurationPanelLayout.setHorizontalGroup(MinerConfigurationPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(MinerConfigurationPanelLayout.createSequentialGroup().addContainerGap() .addGroup(MinerConfigurationPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(MinerConfigurationPanelLayout.createSequentialGroup() .addComponent(ConfigurationRemoveMinerNameLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(ConfigurationRemoveMinerNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 123, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(ConfigurationRemoveMinerIPLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(ConfigurationRemoveMinerIPTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(ConfigurationRemoveMinerButton)) .addComponent(ConfigurationPromptLabel).addComponent(ConfigurationAddMinersLabel) .addComponent(ConfigurationRemoveMinersLabel) .addComponent(ConfigurationCurrentMinersLabel) .addGroup(MinerConfigurationPanelLayout.createSequentialGroup() .addGroup(MinerConfigurationPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, MinerConfigurationPanelLayout.createSequentialGroup() .addComponent(ConfigurationResolveHostAddressLabel) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent( ConfigurationResolveHostAddressTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 168, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent( ConfigurationResolveHostAddressButton)) .addGroup(MinerConfigurationPanelLayout.createSequentialGroup() .addComponent(ConfigurationAddMinerNameLabel) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(ConfigurationAddMinerNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(21, 21, 21) .addComponent(ConfigurationAddMinerIPLabel) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(ConfigurationAddMinerIPTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(ConfigurationMinerPortLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(ConfigurationMinerPortTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(43, 43, 43).addComponent(ConfigurationAddMinerButton)) .addComponent(ConfigurationCurrentMinersScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 333, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); MinerConfigurationPanelLayout.setVerticalGroup(MinerConfigurationPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(MinerConfigurationPanelLayout.createSequentialGroup().addGap(16, 16, 16) .addComponent(ConfigurationPromptLabel) .addGroup(MinerConfigurationPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(MinerConfigurationPanelLayout.createSequentialGroup().addGap(16, 16, 16) .addComponent(ConfigurationAddMinersLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(MinerConfigurationPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(ConfigurationAddMinerNameLabel) .addComponent(ConfigurationAddMinerNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(ConfigurationAddMinerIPLabel) .addComponent(ConfigurationAddMinerIPTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(ConfigurationMinerPortLabel) .addComponent(ConfigurationMinerPortTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(MinerConfigurationPanelLayout.createSequentialGroup().addGap(37, 37, 37) .addComponent(ConfigurationAddMinerButton))) .addGap(35, 35, 35) .addGroup(MinerConfigurationPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(ConfigurationResolveHostAddressLabel) .addComponent(ConfigurationResolveHostAddressTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(ConfigurationResolveHostAddressButton)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(ConfigurationRemoveMinersLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(MinerConfigurationPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(ConfigurationRemoveMinerNameLabel) .addComponent(ConfigurationRemoveMinerNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(ConfigurationRemoveMinerIPLabel) .addComponent(ConfigurationRemoveMinerIPTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(ConfigurationRemoveMinerButton)) .addGap(25, 25, 25).addComponent(ConfigurationCurrentMinersLabel).addGap(33, 33, 33) .addComponent(ConfigurationCurrentMinersScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 209, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); ConfigurationTabbedPane.addTab("Miners", MinerConfigurationPanel); ConfigurationAlarmSettingsPromptLabel.setFont(new java.awt.Font("DejaVu Serif", 3, 14)); // NOI18N ConfigurationAlarmSettingsPromptLabel.setText("Configure Alarm Settings Here."); ConfigurationMinerTemperatureAlarmLabel.setText("Temperature:"); ConfigurationMinerFanSpeedAlarmLabel.setText("Fan Speed:"); ConfigurationMinerHashRateAlarmLabel.setText("Hash Rate:"); MinerSelectionForAlarmsBox.setModel(new javax.swing.DefaultComboBoxModel(miners.toArray())); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, MinerSelectionBox5, org.jdesktop.beansbinding.ELProperty.create("${selectedItem}"), MinerSelectionForAlarmsBox, org.jdesktop.beansbinding.BeanProperty.create("selectedItem")); bindingGroup.addBinding(binding); AlarmsCurrentMinerLabel.setText("Current Miner:"); ConfigurationAlarmsHWErrPercentLabel.setText("Hardware Errors:"); ConfigurationMinerTempAlarmTextField.setHorizontalAlignment(javax.swing.JTextField.RIGHT); ConfigurationFanSpeedAlarmTextField.setHorizontalAlignment(javax.swing.JTextField.RIGHT); ConfigurationMinerHashRateAlarmTextField.setHorizontalAlignment(javax.swing.JTextField.RIGHT); ConfigurationMinerHardwareErrPercentAlarmTextField.setHorizontalAlignment(javax.swing.JTextField.RIGHT); ConfigurationDegreesCelsiusLabel.setText("C"); ConfigurationFanRPMLabel.setText("RPM"); ConfigurationHashRatePostfixComboBox .setModel(new javax.swing.DefaultComboBoxModel(new String[] { "TH/s", "GH/s", "MH/s" })); ConfigurationHashRatePostfixComboBox.setSelectedIndex(1); ConfigurationHWErrorPercentLabel.setText("%"); ConfigurationMinerTempAlarmUpdateButton.setText("Update"); ConfigurationMinerTempAlarmUpdateButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { ConfigurationMinerTempAlarmUpdateButtonActionPerformed(evt); } }); ConfigurationMinerFanSpeedAlarmUpdateButton.setText("Update"); ConfigurationMinerFanSpeedAlarmUpdateButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { ConfigurationMinerFanSpeedAlarmUpdateButtonActionPerformed(evt); } }); ConfigurationMinerHashRateAlarmUpdateButton.setText("Update"); ConfigurationMinerHashRateAlarmUpdateButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { ConfigurationMinerHashRateAlarmUpdateButtonActionPerformed(evt); } }); ConfigurationMinerHardwareErrPercentAlarmUpdateButton.setText("Update"); ConfigurationMinerHardwareErrPercentAlarmUpdateButton .addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { ConfigurationMinerHardwareErrPercentAlarmUpdateButtonActionPerformed(evt); } }); ConfigurationCurrentMinerAlarmsTextPane.setContentType(("text/html")); /*StringBuffer current_alarms = new StringBuffer(); String temp = new String(); Object temp_type = new Object(); HashMap<String, Object> temp_alarms = new HashMap<>(); current_alarms.append(CurrentAlarmsHeader); System.out.println(existing_miners.toString()); for (int i = 0; i < existing_miners.size(); i++) { temp = existing_miners.get(i).get("name"); if (temp.equals("No Miners")) { current_alarms.append(newrow); for (int j = 0; j < 5; j++) { current_alarms.append("None"); if (j == 4) { break; } current_alarms.append(newcolumn); } current_alarms.append(closerow); current_alarms.append(VitalStatsFooter); System.out.println(current_alarms.toString()); break; } temp_alarms = cfg.getAlarms(temp); if (temp_alarms == null) { current_alarms.append(newrow); current_alarms.append(temp); current_alarms.append(newcolumn); for (int j = 0; j < 4; j++) { current_alarms.append("None"); if (j == 3) { break; } current_alarms.append(newcolumn); } current_alarms.append(closerow); current_alarms.append(VitalStatsFooter); System.out.println(current_alarms.toString()); break; } current_alarms.append(newrow); current_alarms.append(temp); current_alarms.append(newcolumn); current_alarms.append(temp_alarms.get("fan")); current_alarms.append(newcolumn); current_alarms.append(temp_alarms.get("temp")); current_alarms.append(newcolumn); temp_type = temp_alarms.get("hash_rate_type"); temp_type = (temp_type == null) ? "GH/s" : temp_type.toString(); current_alarms.append(temp_alarms.get("hash_rate") + " " + temp_type); current_alarms.append(newcolumn); current_alarms.append(temp_alarms.get("hw_err")); current_alarms.append(closerow); current_alarms.append(VitalStatsFooter); } ConfigurationCurrentMinerAlarmsTextPane.setText(current_alarms.toString()); */ ConfigurationCurrentMinerAlarmsTextPanePropertyChange(null); ConfigurationCurrentMinerAlarmsTextPane.addPropertyChangeListener(new java.beans.PropertyChangeListener() { public void propertyChange(java.beans.PropertyChangeEvent evt) { ConfigurationCurrentMinerAlarmsTextPanePropertyChange(evt); } }); ConfigurationCurrentMinerAlarmsScrollPane.setViewportView(ConfigurationCurrentMinerAlarmsTextPane); ConfigurationCurrentMinerAlarmsLabel.setFont(new java.awt.Font("DejaVu Serif", 3, 12)); // NOI18N ConfigurationCurrentMinerAlarmsLabel.setText("Current alarms:"); javax.swing.GroupLayout ConfigurationAlarmPanelLayout = new javax.swing.GroupLayout( ConfigurationAlarmPanel); ConfigurationAlarmPanel.setLayout(ConfigurationAlarmPanelLayout); ConfigurationAlarmPanelLayout.setHorizontalGroup(ConfigurationAlarmPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(ConfigurationAlarmPanelLayout.createSequentialGroup().addContainerGap() .addGroup(ConfigurationAlarmPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(ConfigurationCurrentMinerAlarmsScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 371, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(ConfigurationAlarmPanelLayout.createSequentialGroup() .addGroup(ConfigurationAlarmPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(ConfigurationAlarmSettingsPromptLabel, javax.swing.GroupLayout.Alignment.LEADING) .addGroup(ConfigurationAlarmPanelLayout.createSequentialGroup() .addGroup(ConfigurationAlarmPanelLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(ConfigurationAlarmsHWErrPercentLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent( ConfigurationMinerTemperatureAlarmLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(ConfigurationMinerFanSpeedAlarmLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(ConfigurationMinerHashRateAlarmLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(AlarmsCurrentMinerLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(ConfigurationAlarmPanelLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent(MinerSelectionForAlarmsBox, javax.swing.GroupLayout.PREFERRED_SIZE, 173, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(ConfigurationAlarmPanelLayout .createSequentialGroup() .addGroup(ConfigurationAlarmPanelLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent( ConfigurationMinerHardwareErrPercentAlarmTextField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 129, Short.MAX_VALUE) .addComponent( ConfigurationMinerHashRateAlarmTextField, javax.swing.GroupLayout.Alignment.LEADING) .addComponent( ConfigurationFanSpeedAlarmTextField, javax.swing.GroupLayout.Alignment.LEADING) .addComponent( ConfigurationMinerTempAlarmTextField, javax.swing.GroupLayout.Alignment.LEADING)) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(ConfigurationAlarmPanelLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent( ConfigurationDegreesCelsiusLabel) .addComponent( ConfigurationFanRPMLabel) .addComponent( ConfigurationHashRatePostfixComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent( ConfigurationHWErrorPercentLabel)))))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(ConfigurationAlarmPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(ConfigurationMinerHashRateAlarmUpdateButton) .addComponent(ConfigurationMinerHardwareErrPercentAlarmUpdateButton) .addComponent(ConfigurationMinerTempAlarmUpdateButton) .addComponent(ConfigurationMinerFanSpeedAlarmUpdateButton))) .addComponent(ConfigurationCurrentMinerAlarmsLabel)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); ConfigurationAlarmPanelLayout.setVerticalGroup(ConfigurationAlarmPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(ConfigurationAlarmPanelLayout.createSequentialGroup().addContainerGap() .addComponent(ConfigurationAlarmSettingsPromptLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(ConfigurationAlarmPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(AlarmsCurrentMinerLabel).addComponent(MinerSelectionForAlarmsBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(ConfigurationAlarmPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(ConfigurationMinerTemperatureAlarmLabel) .addComponent(ConfigurationMinerTempAlarmTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(ConfigurationDegreesCelsiusLabel) .addComponent(ConfigurationMinerTempAlarmUpdateButton)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(ConfigurationAlarmPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(ConfigurationMinerFanSpeedAlarmLabel) .addComponent(ConfigurationFanSpeedAlarmTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(ConfigurationFanRPMLabel) .addComponent(ConfigurationMinerFanSpeedAlarmUpdateButton)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(ConfigurationAlarmPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(ConfigurationMinerHashRateAlarmLabel) .addComponent(ConfigurationMinerHashRateAlarmTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(ConfigurationHashRatePostfixComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(ConfigurationMinerHashRateAlarmUpdateButton)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(ConfigurationAlarmPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(ConfigurationAlarmsHWErrPercentLabel) .addComponent(ConfigurationMinerHardwareErrPercentAlarmTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(ConfigurationHWErrorPercentLabel) .addComponent(ConfigurationMinerHardwareErrPercentAlarmUpdateButton)) .addGap(18, 18, 18).addComponent(ConfigurationCurrentMinerAlarmsLabel).addGap(18, 18, 18) .addComponent(ConfigurationCurrentMinerAlarmsScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); ConfigurationTabbedPane.addTab("Alarms", ConfigurationAlarmPanel); ConfigurationEligiusLabel.setFont(new java.awt.Font("DejaVu Serif", 3, 14)); // NOI18N ConfigurationEligiusLabel.setText("Eligius"); ConfigurationMiningPoolPromptLabel.setFont(new java.awt.Font("DejaVu Serif", 3, 18)); // NOI18N ConfigurationMiningPoolPromptLabel.setText("Use this tab to configure mining pools"); ConfigurationEligiusUsernameLabel.setText("Eligius Username*:"); ConfigurationEligiusHelpPromptLabel.setFont(new java.awt.Font("Monospaced", 0, 10)); // NOI18N ConfigurationEligiusHelpPromptLabel.setText("*For more information about these fields, please see help*"); ConfigurationEligiusUsernameAddButton.setText("Add"); ConfigurationEligiusUsernameAddButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { ConfigurationEligiusUsernameAddButtonActionPerformed(evt); } }); ConfigurationEligiusUsernameRemoveButton.setText("Remove"); ConfigurationEligiusUsernameRemoveButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { ConfigurationEligiusUsernameRemoveButtonActionPerformed(evt); } }); ConfigurationEligiusExampleLabel.setFont(new java.awt.Font("DejaVu Serif", 0, 10)); // NOI18N ConfigurationEligiusExampleLabel.setText( "*User name is the same as Mining Address for example: \"1EXfBqvLTyFbL6Dr5CG1fjxNKEPSezg7yF\""); javax.swing.GroupLayout ConfigurationEligiusPoolsPanelLayout = new javax.swing.GroupLayout( ConfigurationEligiusPoolsPanel); ConfigurationEligiusPoolsPanel.setLayout(ConfigurationEligiusPoolsPanelLayout); ConfigurationEligiusPoolsPanelLayout.setHorizontalGroup(ConfigurationEligiusPoolsPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(ConfigurationEligiusPoolsPanelLayout.createSequentialGroup().addContainerGap() .addGroup(ConfigurationEligiusPoolsPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(ConfigurationEligiusPoolsPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(ConfigurationEligiusPoolsPanelLayout.createSequentialGroup() .addComponent(ConfigurationMiningPoolPromptLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(ConfigurationEligiusHelpPromptLabel)) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, ConfigurationEligiusPoolsPanelLayout.createSequentialGroup() .addComponent(ConfigurationEligiusUsernameLabel) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(ConfigurationEligiusUsernameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 256, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(ConfigurationEligiusUsernameAddButton) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(ConfigurationEligiusUsernameRemoveButton))) .addComponent(ConfigurationEligiusLabel) .addGroup(ConfigurationEligiusPoolsPanelLayout.createSequentialGroup() .addGap(12, 12, 12).addComponent(ConfigurationEligiusExampleLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 527, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); ConfigurationEligiusPoolsPanelLayout.setVerticalGroup( ConfigurationEligiusPoolsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(ConfigurationEligiusPoolsPanelLayout.createSequentialGroup().addContainerGap() .addGroup(ConfigurationEligiusPoolsPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(ConfigurationEligiusHelpPromptLabel) .addComponent(ConfigurationMiningPoolPromptLabel)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(ConfigurationEligiusLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(ConfigurationEligiusPoolsPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(ConfigurationEligiusUsernameLabel) .addComponent(ConfigurationEligiusUsernameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(ConfigurationEligiusUsernameAddButton) .addComponent(ConfigurationEligiusUsernameRemoveButton)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(ConfigurationEligiusExampleLabel) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); ConfigurationTabbedPane.addTab("Pools", ConfigurationEligiusPoolsPanel); ConfigurationCoinExchangePanel.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N ConfigurationCoinbaseLabel.setFont(new java.awt.Font("DejaVu Serif", 3, 14)); // NOI18N ConfigurationCoinbaseLabel.setText("Configure Coinbase Here"); ConfigurationCoinbaseCurrencyLabel.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N ConfigurationCoinbaseCurrencyLabel.setText("Preferred Exchange Currency:"); ConfigurationCoinbaseCurrencyComboBox.setModel( new javax.swing.DefaultComboBoxModel(PlanetCryptoBitcoinCoinbaseCurrency.coinbaseCurrencies())); /* new javax.swing.DefaultComboBoxModel( new String[]{ "Select", "AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BRL", "BSD", "BTC", "BTN", "BWP", "BYR", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EEK", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LVL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRO", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLL", "SOS", "SRD", "STD", "SVC", "SYP", "SZL", "THB", "TJS", "TMM", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "UY", "UZS", "VEF", "VND", "VUV", "WST", "XAF", "XCD", "XOF", "XPF", "YER", "ZAR", "ZMK", "ZWL" } */ CoinbaseInformationLabel.setFont(new java.awt.Font("DejaVu Serif", 3, 14)); // NOI18N CoinbaseInformationLabel.setText("Coinbase User API Information"); CoinbaseUsernameLabel.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N CoinbaseUsernameLabel.setText("Coinbase Username:"); CoinbaseAPIKeyLabel.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N CoinbaseAPIKeyLabel.setText("Coinbase API Key:"); CoinbaseAPISecretKeyLabel.setFont(new java.awt.Font("DejaVu Serif", 1, 12)); // NOI18N CoinbaseAPISecretKeyLabel.setText("Coinbase API Secret:"); AddCoinbaseUsernameButton.setText("Add/Update"); AddCoinbaseUsernameButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { AddCoinbaseUsernameButtonActionPerformed(evt); } }); RemoveCoinbaseUsernameButton.setText("Remove"); RemoveCoinbaseUsernameButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { RemoveCoinbaseUsernameButtonActionPerformed(evt); } }); CurrentCoinbaseConfigurationLabel.setFont(new java.awt.Font("DejaVu Serif", 3, 14)); // NOI18N CurrentCoinbaseConfigurationLabel.setText("Current Coinbase Configuration:"); CurrentCoinbaseConfigurationTextPane.setEditable(false); CurrentCoinbaseConfigurationTextPane.setContentType("text/html"); // NOI18N /* existing_coinbase = currentCoinbase(); if (existing_coinbase == null) { CurrentCoinbaseConfigurationTextPane.setText("<html><body><p><b>No Configuration</b></p></body></html>"); } else { CurrentCoinbaseConfigurationTextPane.setText(existing_coinbase.toString()); } */ CurrentCoinbaseConfigurationTextPane.addPropertyChangeListener(new java.beans.PropertyChangeListener() { public void propertyChange(java.beans.PropertyChangeEvent evt) { CurrentCoinbaseConfigurationTextPanePropertyChange(evt); } }); CurrentCoinbaseConfigurationScrollPane.setViewportView(CurrentCoinbaseConfigurationTextPane); CoinbaseConfigurationVerticalSeparator.setOrientation(javax.swing.SwingConstants.VERTICAL); CoinbaseConfigurationInstructionsTextPane.setEditable(false); CoinbaseConfigurationInstructionsTextPane.setContentType("text/html"); // NOI18N CoinbaseConfigurationInstructionsTextPane.setFont(new java.awt.Font("DejaVu Serif", 0, 12)); // NOI18N CoinbaseConfigurationInstructionsTextPane.setText( "<html>\n <head>\n <style>\n body {background:#D6D9DF }\n </style>\n </head>\n <body>\n <ul>\n <li>At a minimum <b>Coinbase Username</b> and <b>Preferred Exchange Currency</b> are required.</li>\n <li>To add the minimum required parameters: \n <ol>\n <li>Enter the <b>Coinbase Username</b> to add</li>\n <li>Select your <b>Preferred Exchange Currency</b></li>\n <li>Click <b>Add/Update</b></li>\n </ol>\n </li>\n <li>To add an API Key:\n <ol>\n <li>Enter the <b>Coinbase Username</b> to associate with key</li>\n <li>Enter <b>Coinbase API Key</b> value</li>\n <li>Enter <b>Coinbase API Secret</b> Value</li>\n <li>Select your <b>Preferred Exchange Currency</b></li>\n <li>Click <b>Add/Update</b></li>\n </ol>\n </li>\n <li>To update/remove configuration associated with a <b>Coinbase Username</b></li>\n <ol>\n <li>Enter the <b>Coinbase Username</b> to update</li>\n <li><b>If removing this configuration, simply click \"Remove\"</b></li>\n <ul><li><b>Warning: This will remove ALL information from this app associated with this Coinbase Username</b></li></ul>\n <li><b>If updating this configuration:</b></li>\n <ul><li>Enter/Select the field to update, and click <b>Add/Update</b></li></ul>\n </ol>\n </ul>\n </body>\n</html>\n"); CoinbaseConfigurationInstructionsTextPane.setCaretPosition(0); CoinbaseConfigurationInstructionsScrollPane.setViewportView(CoinbaseConfigurationInstructionsTextPane); CoinbaseConfigurationInstructionsLabel.setFont(new java.awt.Font("DejaVu Serif", 3, 14)); // NOI18N CoinbaseConfigurationInstructionsLabel.setText("Configuration Instructions:"); javax.swing.GroupLayout ConfigurationCoinExchangePanelLayout = new javax.swing.GroupLayout( ConfigurationCoinExchangePanel); ConfigurationCoinExchangePanel.setLayout(ConfigurationCoinExchangePanelLayout); ConfigurationCoinExchangePanelLayout.setHorizontalGroup(ConfigurationCoinExchangePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(ConfigurationCoinExchangePanelLayout.createSequentialGroup().addContainerGap() .addGroup(ConfigurationCoinExchangePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(CurrentCoinbaseConfigurationScrollPane) .addComponent(ConfigurationCoinbaseLabel) .addGroup(ConfigurationCoinExchangePanelLayout.createSequentialGroup() .addGroup(ConfigurationCoinExchangePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(ConfigurationCoinExchangePanelLayout .createSequentialGroup() .addGroup(ConfigurationCoinExchangePanelLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addGroup( javax.swing.GroupLayout.Alignment.TRAILING, ConfigurationCoinExchangePanelLayout .createSequentialGroup() .addComponent( ConfigurationCoinbaseCurrencyLabel) .addGap(18, 18, 18).addComponent( ConfigurationCoinbaseCurrencyComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 263, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(ConfigurationCoinExchangePanelLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent( CoinbaseConfigurationSeparator1, javax.swing.GroupLayout.Alignment.LEADING) .addComponent(CoinbaseInformationLabel, javax.swing.GroupLayout.Alignment.LEADING) .addGroup( javax.swing.GroupLayout.Alignment.LEADING, ConfigurationCoinExchangePanelLayout .createSequentialGroup() .addGroup( ConfigurationCoinExchangePanelLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent( CoinbaseUsernameLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent( CoinbaseAPISecretKeyLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent( CoinbaseAPIKeyLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(18, 18, 18) .addGroup( ConfigurationCoinExchangePanelLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent( CoinbaseAPIUsernameTextField) .addComponent( CoinbaseAPIKeyTextField) .addComponent( CoinbaseAPISecretKeyTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 330, Short.MAX_VALUE))) .addComponent( CoinbaseConfigurationSeparator, javax.swing.GroupLayout.Alignment.LEADING))) .addGap(0, 0, 0) .addComponent(CoinbaseConfigurationVerticalSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 12, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(CurrentCoinbaseConfigurationLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 266, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(32, 32, 32).addComponent(AddCoinbaseUsernameButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(RemoveCoinbaseUsernameButton)) .addComponent(CoinbaseConfigurationInstructionsLabel) .addComponent(CoinbaseConfigurationInstructionsScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 791, Short.MAX_VALUE)) .addContainerGap(17, Short.MAX_VALUE))); ConfigurationCoinExchangePanelLayout.setVerticalGroup(ConfigurationCoinExchangePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(ConfigurationCoinExchangePanelLayout.createSequentialGroup().addContainerGap() .addComponent(ConfigurationCoinbaseLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(ConfigurationCoinExchangePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(ConfigurationCoinExchangePanelLayout.createSequentialGroup() .addComponent(CoinbaseConfigurationSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(CoinbaseInformationLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(ConfigurationCoinExchangePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(CoinbaseUsernameLabel) .addComponent(CoinbaseAPIUsernameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(ConfigurationCoinExchangePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(CoinbaseAPIKeyLabel) .addComponent(CoinbaseAPIKeyTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(AddCoinbaseUsernameButton) .addComponent(RemoveCoinbaseUsernameButton)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(ConfigurationCoinExchangePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(CoinbaseAPISecretKeyTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(CoinbaseAPISecretKeyLabel)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(ConfigurationCoinExchangePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(ConfigurationCoinbaseCurrencyLabel) .addComponent(ConfigurationCoinbaseCurrencyComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(CoinbaseConfigurationSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(ConfigurationCoinExchangePanelLayout.createSequentialGroup() .addComponent(CoinbaseConfigurationVerticalSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 172, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(CurrentCoinbaseConfigurationLabel))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(CurrentCoinbaseConfigurationScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 169, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(CoinbaseConfigurationInstructionsLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(CoinbaseConfigurationInstructionsScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 147, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(21, 21, 21))); ConfigurationTabbedPane.addTab("Coin Exchange", ConfigurationCoinExchangePanel); javax.swing.GroupLayout ConfigurationPanelLayout = new javax.swing.GroupLayout(ConfigurationPanel); ConfigurationPanel.setLayout(ConfigurationPanelLayout); ConfigurationPanelLayout.setHorizontalGroup( ConfigurationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup( javax.swing.GroupLayout.Alignment.TRAILING, ConfigurationPanelLayout.createSequentialGroup() .addContainerGap().addComponent(ConfigurationTabbedPane).addContainerGap())); ConfigurationPanelLayout.setVerticalGroup( ConfigurationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(ConfigurationTabbedPane)); MainTabbedPane.addTab("Configuration", ConfigurationPanel); FileMenu.setText("File"); FileExitMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Q, java.awt.event.InputEvent.ALT_MASK)); FileExitMenuItem.setText("Quit"); FileExitMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { FileExitMenuItemActionPerformed(evt); } }); FileMenu.add(FileExitMenuItem); BFGMInerUIMenuBar.add(FileMenu); EditMenu.setText("Edit"); EditMenu.setMnemonic(KeyEvent.VK_E); CopyMenuItem.setText("Copy"); CopyMenuItem.setMnemonic(KeyEvent.VK_C); EditMenu.add(CopyMenuItem); PasteMenuItem.setText("Paste"); PasteMenuItem.setMnemonic(KeyEvent.VK_P); EditMenu.add(PasteMenuItem); BFGMInerUIMenuBar.add(EditMenu); HelpMenu.setText("Help"); AppHelpMenuItem.setText("App Help"); AppHelpMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { AppHelpMenuItemActionPerformed(evt); } }); HelpMenu.add(AppHelpMenuItem); AboutMenuItem.setText("About BFGMinerAPI"); AboutMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { AboutMenuItemActionPerformed(evt); } }); HelpMenu.add(AboutMenuItem); BFGMInerUIMenuBar.add(HelpMenu); setJMenuBar(BFGMInerUIMenuBar); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(MainTabbedPane, javax.swing.GroupLayout.Alignment.TRAILING)); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(MainTabbedPane)); MainTabbedPane.getAccessibleContext().setAccessibleName(""); bindingGroup.bind(); pack(); }
From source file:plugin.notes.gui.NotesView.java
private void pasteButtonActionPerformed(java.awt.event.ActionEvent evt) { //GEN-FIRST:event_pasteButtonActionPerformed performTextPaneAction(DefaultEditorKit.pasteAction, evt); }
From source file:storybook.toolkit.swing.SwingUtil.java
public static void addCopyPasteToPopupMenu(JPopupMenu menu, JComponent comp) { HashMap<Object, Action> actions = SwingUtil.createActionTable((JTextComponent) comp); Action cutAction = actions.get(DefaultEditorKit.cutAction); JMenuItem miCut = new JMenuItem(cutAction); miCut.setText(I18N.getMsg("msg.common.cut")); miCut.setIcon(I18N.getIcon("icon.small.cut")); menu.add(miCut);// ww w .ja va2 s. co m Action copyAction = actions.get(DefaultEditorKit.copyAction); JMenuItem miCopy = new JMenuItem(copyAction); miCopy.setText(I18N.getMsg("msg.common.copy")); miCopy.setIcon(I18N.getIcon("icon.small.copy")); menu.add(miCopy); Action pasteAction = actions.get(DefaultEditorKit.pasteAction); JMenuItem miPaste = new JMenuItem(pasteAction); miPaste.setText(I18N.getMsg("msg.common.paste")); miPaste.setIcon(I18N.getIcon("icon.small.paste")); menu.add(miPaste); }