Package java.awt

Examples of java.awt.Dimension


    }

    public Dimension getPreferredSize() {
      int width = mFontMetrics.stringWidth(mFormatter.formatTime(23, 0)) + 4;
      int height = 1000000; // We don't know the size
      return new Dimension(width, height);
    }
View Full Code Here


    mCorrectionCB.setSelectedIndex(mChannel.getTimeZoneCorrectionMinutes() / 15 + 4);
    panel.add(mCorrectionCB, cc.xy(3, 11));

    JTextArea txt = UiUtilities.createHelpTextArea(mLocalizer.msg("DLSTNote", ""));
    // Hack because of growing JTextArea in FormLayout
    txt.setMinimumSize(new Dimension(150, 20));
    panel.add(txt, cc.xy(3, 13));

    // time limitation
    panel.add(DefaultComponentFactory.getInstance().createLabel(mLocalizer.msg("timeLimits","Time limits:")), cc.xy(1,15));
   
    String timePattern = mLocalizer.msg("timePattern", "hh:mm a");
       
    mStartTimeLimit = new JSpinner(new SpinnerDateModel());
    mStartTimeLimit.setEditor(new JSpinner.DateEditor(mStartTimeLimit, timePattern));
    setTimeDate(mStartTimeLimit, mChannel.getStartTimeLimit());

    mEndTimeLimit = new JSpinner(new SpinnerDateModel());
    mEndTimeLimit.setEditor(new JSpinner.DateEditor(mEndTimeLimit, timePattern));
    setTimeDate(mEndTimeLimit, mChannel.getEndTimeLimit());
       
    ((JSpinner.DateEditor)mStartTimeLimit.getEditor()).getTextField().setHorizontalAlignment(SwingConstants.LEFT);
    ((JSpinner.DateEditor)mEndTimeLimit.getEditor()).getTextField().setHorizontalAlignment(SwingConstants.LEFT);
   
    CaretPositionCorrector.createCorrector(((JSpinner.DateEditor)mStartTimeLimit.getEditor()).getTextField(), new char[] {':'}, -1);
    CaretPositionCorrector.createCorrector(((JSpinner.DateEditor)mEndTimeLimit.getEditor()).getTextField(), new char[] {':'}, -1);
   
    PanelBuilder timeLimitPanel = new PanelBuilder(new FormLayout("default:grow,10dlu,default:grow","default,2dlu,default"));
   
    timeLimitPanel.addLabel(mLocalizer.msg("startTime","Start time:"), cc.xy(1,1));
    timeLimitPanel.addLabel(mLocalizer.msg("endTime","End time:"), cc.xy(3,1));
    timeLimitPanel.add(mStartTimeLimit, cc.xy(1,3));
    timeLimitPanel.add(mEndTimeLimit, cc.xy(3,3));
   
    panel.add(timeLimitPanel.getPanel(), cc.xy(3,15));
   
    JTextArea txt2 = UiUtilities.createHelpTextArea(mLocalizer.msg("DLSTNote", ""));
    // Hack because of growing JTextArea in FormLayout
    txt2.setMinimumSize(new Dimension(150, 20));
    panel.add(txt2, cc.xy(3, 17));
   
    // buttons
    ButtonBarBuilder2 builder = new ButtonBarBuilder2();
    JButton defaultButton = new JButton(Localizer.getLocalization(Localizer.I18N_DEFAULT));
   
    defaultButton.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        resetToDefaults();
      }

    });
   
    builder.addButton(defaultButton);
    builder.addRelatedGap();
    builder.addGlue();

    mOKBt = new JButton(Localizer.getLocalization(Localizer.I18N_OK));
    mOKBt.addActionListener(this);
   
    getRootPane().setDefaultButton(mOKBt);
   
    mCloseBt = new JButton(Localizer.getLocalization(Localizer.I18N_CANCEL));
    mCloseBt.addActionListener(this);

    builder.addButton(new JButton[] { mOKBt, mCloseBt });

    panel.add(new JSeparator(), cc.xyw(1, 19, 3));
    panel.add(builder.getPanel(), cc.xyw(1, 21, 3));
   
    pack();
    Settings.layoutWindow("channelConfig", this, new Dimension(420,350));
  }
View Full Code Here

            return;
        }

        calendarDateField.setValue(settings.getStartDate().toDate());
        visibleDays = settings.getNumberOfDays();
        Dimension prefSize = new Dimension(visibleDays * dayWidth,
                getHoursPerDay() * hourWidth);

        rowHeader.setPreferredSize(new Dimension(rowHeaderWidth, prefSize.height));
        columnHeader.setPreferredSize(new Dimension(prefSize.width, columnHeaderHeight));
        timetableGrid.setMaximumSize(prefSize);
        timetableGrid.setPreferredSize(prefSize);
    }
View Full Code Here

    super(taskMessage, preferences, controller);
    this.preferences = preferences;
    this.iconPreviewComponent = new ModelPreviewComponent();
    Insets insets = this.iconPreviewComponent.getInsets();
    this.iconPreviewComponent.setPreferredSize(
        new Dimension(128 + insets.left + insets.right, 128  + insets.top + insets.bottom));
    // Change layout
    GridBagLayout layout = new GridBagLayout();
    setLayout(layout);
    layout.setConstraints(getComponent(0), new GridBagConstraints(1, 0, 1, 1, 0, 1,
        GridBagConstraints.SOUTHWEST, GridBagConstraints.NONE, new Insets(0, 0, 10, 0), 0, 0));
View Full Code Here

    ActionMap actionMap = getActionMap();
    toolBar.add(new ResourceAction.ToolBarAction(actionMap.get(EditorView.ActionType.NEW_LIBRARY)));
    toolBar.add(new ResourceAction.ToolBarAction(actionMap.get(EditorView.ActionType.OPEN)));
    toolBar.add(new ResourceAction.ToolBarAction(actionMap.get(EditorView.ActionType.SAVE)));
    toolBar.add(new ResourceAction.ToolBarAction(actionMap.get(EditorView.ActionType.SAVE_AS)));
    toolBar.add(Box.createRigidArea(new Dimension(2, 2)));
    toolBar.add(new ResourceAction.ToolBarAction(actionMap.get(EditorView.ActionType.PREFERENCES)));
    toolBar.addSeparator();
    toolBar.add(new ResourceAction.ToolBarAction(actionMap.get(ActionType.IMPORT_FURNITURE)));
    toolBar.add(new ResourceAction.ToolBarAction(actionMap.get(ActionType.MODIFY_FURNITURE)));
    toolBar.add(new ResourceAction.ToolBarAction(actionMap.get(ActionType.DELETE)));
    toolBar.add(Box.createRigidArea(new Dimension(2, 2)));
    JComponent furnitureLanguageView = (JComponent)controller.getFurnitureLanguageController().getView();
    furnitureLanguageView.setMaximumSize(furnitureLanguageView.getPreferredSize());
    toolBar.add(furnitureLanguageView);
    toolBar.addSeparator();
    toolBar.add(new ResourceAction.ToolBarAction(actionMap.get(EditorView.ActionType.ABOUT)));
View Full Code Here

                            + e.getMessage());
                    exp.setStackTrace(e.getStackTrace());
                    throw exp;
                }
                dialogPanel.add(scroller, BorderLayout.CENTER);
                dialogPanel.setPreferredSize(new Dimension(scroller.getPreferredSize().width, 300));
            } else {
                /** CHANGED **/
                dialogPanel.add(createApplicationDescriptorComponent(), BorderLayout.CENTER);
                // Set the preferred size
                dialogPanel.setPreferredSize(new Dimension( 300, 200));
            }
            dialogPanel.add(new JSeparator(), BorderLayout.SOUTH);
            return dialogPanel;
        }
View Full Code Here

                @Override
                protected String getFinishCommandId() {
                    return "setup." + super.getFinishCommandId();
                }
            };
            wizardDialog.setPreferredSize(new Dimension(500, 300));
        }
        wizardDialog.showDialog();
    }
View Full Code Here

        // Uncomment to hide the menubar, toolbar, or alter window size...
        // configurer.setShowMenuBar(false);
        // configurer.setShowToolBar(false);
        Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
        configurer.setInitialSize(new Dimension(rect.width, rect.height));

        if (!appSettings.isAutoImport())
            return;

        File storageFile = appSettings.getStorageFile();
View Full Code Here

        // Enable a popup menu
        masterTable.addMouseListener(new PopupMenuMouseListener(getPopupMenu()));

        // Avoid the default viewport size of 450,400
        Dimension ps = masterTable.getPreferredSize();
        masterTable.setPreferredScrollableViewportSize(ps);

        TableFormBuilder formBuilder = new TableFormBuilder(getBindingFactory());
        formBuilder.getLayoutBuilder().cell(createMainPanel(),
                "align=default,default rowSpec=fill:default:g");
View Full Code Here

    mAction.putValue(Action.SMALL_ICON,a.getValue(Action.SMALL_ICON));

    Component c;

    if(ContextMenuSeparatorAction.getInstance().equals(menu.getAction())) {
      parent.add(Box.createRigidArea(new Dimension(0,2)));
      c = parent.add(new JSeparator());
      parent.add(Box.createRigidArea(new Dimension(0,2)));
    }
    else {
      c = parent.add(mAction);
    }
View Full Code Here

TOP

Related Classes of java.awt.Dimension

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