private JPanel createButtons() { final JPanel buttonPanel; if (buttons.equals(Buttons.OK)) { buttonPanel = ButtonBarFactory.buildOKBar(createOkButton()); } else if (buttons.equals(Buttons.OK_CANCEL)) { buttonPanel = ButtonBarFactory.buildOKCancelBar(createOkButton(), createCancelButton()); } else if (buttons.equals(Buttons.OK_APPLY_CANCEL)) { buttonPanel = ButtonBarFactory.buildOKCancelApplyBar( createOkButton(), createCancelButton(), createApplyButton()); } else if (buttons.equals(Buttons.CLOSE)) { buttonPanel = ButtonBarFactory.buildCloseBar(createCloseButton()); } else { throw new NotImplementedException( "Oops! Forgot to take in account these buttons: " + buttons); } buttonPanel.setBorder(Borders.DLU4_BORDER); final JPanel panel = new JPanel(new BorderLayout()); panel.add(buttonPanel, BorderLayout.CENTER); panel.add(new JSeparator(), BorderLayout.NORTH); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); return panel; }
public String mainNav(SessionState ss) { String s = "<form name='language' method='post'><tr><td width='650'>" + "<table width='650' cellpadding='0' cellspacing='0' border='0' align='center' class='margin_set'><tr>" + Buttons.roundButton(Buttons.getBut21(ss), ss) + "<td width='550' align='center'>" + getLinks(ss) + "</td></tr></table></td></tr></form>"; return s; }
// returns a form for handling the whether the page is displayed in E or J, and prints the links public String mainNav(SessionState ss) { String s = "<form name='lang' method='post' accept-charset='UTF-8' action='/hartbook/Language'><tr><td class='body_top' width='650'>" + "<table width='650' cellpadding='0' cellspacing='0' border='" + bord + "' align='center' class='margin_set'><tr>" + Buttons.roundButton(Buttons.getBut21(ss), ss) + "<td width='550' align='center'>" + getLinks(ss) + "</td></tr></table></td></tr></form>"; return s; }
/** * Create the GUI and show it. For thread safety, this method should be invoked from the * event-dispatching thread. */ private static void createAndShowGUI() { // Create and set up the window. JFrame frame = new JFrame("Vote"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // Create and set up the content pane. Buttons newContentPane = new Buttons(); newContentPane.setOpaque(true); // content panes must be opaque frame.setContentPane(newContentPane); // Display the window. frame.pack(); frame.setVisible(true); }
protected void createButton(int x, int y, Buttons button) { buttonList.add( new IconButton( buttonID++, width / 2 + x, height / 2 + y, ((state & (1L << button.ordinal())) != 0), button, this)); }
public static void main(String[] agrgs) { System.out.println("Initializing..."); init(); new RtThread(10, 100) { public void run() { for (; ; ) { loop(); waitForNextPeriod(); } } }; RtThread.startMission(); while (true) { on = true; tetris(); while (Buttons.getButtons() == 0) ; while (Buttons.getButtons() != 0) ; } }
/** * Act - do whatever the Help wants to do. This method is called whenever the 'Act' or 'Run' * button gets pressed in the environment. */ public void act() { super.act(); imgHelp.setTransparency(255); click(); }
@Override public void restoreState(Hashtable<?, ?> state) { buttons.restoreState(state); commentary.restoreState(state); scene.restoreState(state); }
@Override public void storeState(Hashtable<Object, Object> state) { buttons.storeState(state); commentary.storeState(state); scene.storeState(state); }
public void refresh() { buttons.refresh(); commentary.refresh(); }