本文整理匯總了Java中java.awt.GridBagConstraints.LINE_START屬性的典型用法代碼示例。如果您正苦於以下問題:Java GridBagConstraints.LINE_START屬性的具體用法?Java GridBagConstraints.LINE_START怎麽用?Java GridBagConstraints.LINE_START使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類java.awt.GridBagConstraints
的用法示例。
在下文中一共展示了GridBagConstraints.LINE_START屬性的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: ShowModifiedFilesDialog
/**
* Private constructor
*/
private ShowModifiedFilesDialog() {
setLayout(new GridBagLayout());
modifiedFiles = new JTextArea(10, 40);
modifiedFiles.setLineWrap(true);
modifiedFiles.setWrapStyleWord(true);
modifiedFiles.setEditable(false);
JScrollPane scroll = new JScrollPane(modifiedFiles);
scroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
GridBagConstraints gbc = new GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = 1;
gbc.gridwidth = 1;
gbc.gridheight = 1;
gbc.weightx = 0;
gbc.weighty = 0;
gbc.fill = GridBagConstraints.BOTH;
gbc.anchor = GridBagConstraints.LINE_START;
add(scroll , gbc);
}
開發者ID:oxygenxml,項目名稱:oxygen-dita-translation-package-builder,代碼行數:24,代碼來源:ShowModifiedFilesDialog.java
示例2: addRow
private void addRow(GridBagLayout gb, GridBagConstraints gc, JLabel label, JComboBox<?> choice) {
Insets oldInsets = gc.insets;
gc.weightx = 0.0;
gc.gridx = 0;
gc.fill = GridBagConstraints.HORIZONTAL;
gc.anchor = GridBagConstraints.LINE_START;
gc.insets = new Insets(5, 5, 5, 5);
gb.setConstraints(label, gc);
add(label);
gc.gridx = 1;
gc.fill = GridBagConstraints.VERTICAL;
gb.setConstraints(choice, gc);
add(choice);
gc.gridy++;
gc.insets = oldInsets;
}
示例3: getConstraints
public static GridBagConstraints getConstraints() {
GridBagConstraints c = new GridBagConstraints();
c.gridwidth = 1;
c.gridheight = 1;
c.weightx = 0.5;
c.ipadx = 150;
c.ipady = 2;
c.gridx = 0;
c.gridy = 0;
c.fill = GridBagConstraints.NONE;
c.insets = insets;
c.anchor = GridBagConstraints.LINE_START;
return (c);
}
示例4: setInsideLocation
final public ExtendedGridBagConstraints setInsideLocation(int intPinsideLocation) {
switch (intPinsideLocation) {
case GridBagConstraints.PAGE_START:
case GridBagConstraints.PAGE_END:
case GridBagConstraints.LINE_START:
case GridBagConstraints.LINE_END:
case GridBagConstraints.FIRST_LINE_START:
case GridBagConstraints.FIRST_LINE_END:
case GridBagConstraints.LAST_LINE_START:
case GridBagConstraints.LAST_LINE_END:
case GridBagConstraints.BASELINE:
case GridBagConstraints.BASELINE_LEADING:
case GridBagConstraints.BASELINE_TRAILING:
case GridBagConstraints.ABOVE_BASELINE:
case GridBagConstraints.ABOVE_BASELINE_LEADING:
case GridBagConstraints.ABOVE_BASELINE_TRAILING:
case GridBagConstraints.BELOW_BASELINE:
case GridBagConstraints.BELOW_BASELINE_LEADING:
case GridBagConstraints.BELOW_BASELINE_TRAILING:
Tools.err("strange grid anchor value : ", intPinsideLocation);
//$FALL-THROUGH$
case GridBagConstraints.CENTER:
case GridBagConstraints.NORTH:
case GridBagConstraints.NORTHWEST:
case GridBagConstraints.NORTHEAST:
case GridBagConstraints.SOUTH:
case GridBagConstraints.SOUTHWEST:
case GridBagConstraints.SOUTHEAST:
case GridBagConstraints.WEST:
case GridBagConstraints.EAST:
this.anchor = intPinsideLocation;
break;
default:
Tools.err("bad grid anchor value : ", intPinsideLocation);
}
return this;
}
示例5: OperatorPanel
public OperatorPanel() {
setBackground(new java.awt.Color(0, 0, 0, 0));
setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
GridBagLayout layout = new GridBagLayout();
setLayout(layout);
GridBagConstraints c = new GridBagConstraints();
c.anchor = GridBagConstraints.LINE_START;
c.fill = GridBagConstraints.NONE;
c.weightx = 0;
layout.setConstraints(iconLabel, c);
add(iconLabel);
// name panel
JPanel namePanel = new JPanel();
namePanel.setBackground(new java.awt.Color(0, 0, 0, 0));
GridBagLayout nameLayout = new GridBagLayout();
GridBagConstraints nameC = new GridBagConstraints();
nameC.fill = GridBagConstraints.BOTH;
nameC.insets = new Insets(0, 5, 0, 5);
namePanel.setLayout(nameLayout);
nameLabel.setHorizontalAlignment(SwingConstants.LEFT);
nameLabel.setFont(getFont().deriveFont(Font.PLAIN, 12));
nameC.gridwidth = GridBagConstraints.REMAINDER;
nameLayout.setConstraints(nameLabel, nameC);
namePanel.add(nameLabel);
classLabel.setHorizontalAlignment(SwingConstants.LEFT);
classLabel.setFont(getFont().deriveFont(Font.PLAIN, 10));
nameLayout.setConstraints(classLabel, nameC);
namePanel.add(classLabel);
c.weightx = 1;
add(namePanel, c);
c.gridwidth = GridBagConstraints.RELATIVE;
c.weightx = 0;
layout.setConstraints(breakpoint, c);
add(breakpoint);
c.gridwidth = GridBagConstraints.REMAINDER;
layout.setConstraints(error, c);
add(error);
}
示例6: SettingsPanel
public SettingsPanel() {
setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
setPreferredSize(new Dimension(250,120));
setBackground(Color.WHITE);
this.settingsLabel = new JLabel("USTAWIENIA PARAMETRÓW ANIMACJI");
c.gridx = 0;
c.gridy = 0;
c.gridwidth = 3;
c.insets = new Insets(0,0,2,0);
this.settingsLabel.setFont(this.header);
this.add(this.settingsLabel,c);
this.teethLabel = new JLabel("Liczba ząbków: ");
c.gridy = 1;
c.anchor=GridBagConstraints.LINE_START;
this.teethLabel.setFont(this.mainFont);
this.add(this.teethLabel,c);
Integer[] teeth = {500, 600, 700, 720, 800, 1000};
this.nTeeth = new JComboBox<Integer>(teeth);
c.gridx = 2;
c.gridy = 1;
c.anchor=GridBagConstraints.LINE_END;
this.nTeeth.setFont(this.mainFont);
this.add(this.nTeeth,c);
this.distanceLabel = new JLabel("Odległość od lustra [m] : ");
c.gridx = 0;
c.gridy = 2;
c.insets = new Insets(2,0,0,0);
c.anchor=GridBagConstraints.LINE_START;
this.distanceLabel.setFont(this.mainFont);
this.add(this.distanceLabel,c);
Integer[] dist = {5000, 6000, 7000, 8000, 8633 , 9000, 10000};
this.distance = new JComboBox<Integer>(dist);
c.gridx = 2;
c.anchor=GridBagConstraints.LINE_END;
this.distance.setFont(this.mainFont);
this.add(this.distance,c);
this.velSliderLabel = new JLabel("Prędkośc obrotu koła [rad/s] : ");
c.gridx = 0;
c.gridy = 3;
c.anchor=GridBagConstraints.LINE_START;
this.velSliderLabel.setFont(this.mainFont);
this.add(this.velSliderLabel,c);
this.velLabel = new JLabel("200");
this.velLabel.setFont(this.mainFont);
c.gridx = 1;
c.anchor=GridBagConstraints.LINE_END;
this.add(this.velLabel,c);
this.velSlider = new JSlider(0,2000,200);
c.gridx = 0;
c.gridy = 4;
c.gridwidth = 3;
c.insets = new Insets(0,0,7,0);
c.fill= GridBagConstraints.HORIZONTAL;
c.anchor=GridBagConstraints.LINE_END;
this.velSlider.setBackground(Color.WHITE);
this.velSlider.setMajorTickSpacing(5);
this.velSlider.setSnapToTicks(true);
this.add(this.velSlider,c);
}
示例7: showReport
/**
* Shows a message dialog with the unpacked/overriden files.
*
* @param pluginWorkspaceAccess Entry point for accessing the DITA Maps area.
* @param list The relative paths of the unzipped files.
* @throws IOException Problems reading the files.
*/
private void showReport(final StandalonePluginWorkspace pluginWorkspaceAccess,
ArrayList<String> list) throws IOException {
final PluginResourceBundle resourceBundle = pluginWorkspaceAccess.getResourceBundle();
// Present a log with the overridden files.
if(list != null && !list.isEmpty()){
JTextArea text = new JTextArea(10, 40);
// Iterate with an index and put a new line
// for all lines except the first one.
text.append(list.get(0));
for(int i = 1; i < list.size(); i++){
text.append("\n");
text.append(list.get(i));
}
text.setLineWrap(true);
text.setWrapStyleWord(true);
text.setEditable(false);
JScrollPane scroll = new JScrollPane(text);
scroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
JPanel panel = new JPanel(new GridBagLayout());
GridBagConstraints gbcLabel = new GridBagConstraints();
gbcLabel.gridx = 0;
gbcLabel.gridy = 0;
gbcLabel.gridwidth = 1;
gbcLabel.gridheight = 1;
gbcLabel.weightx = 0;
gbcLabel.weighty = 0;
gbcLabel.fill = GridBagConstraints.HORIZONTAL;
gbcLabel.anchor = GridBagConstraints.NORTH;
panel.add(new JLabel(resourceBundle.getMessage(Tags.SHOW_REPORT_LABEL)), gbcLabel);
GridBagConstraints gbcScroll = new GridBagConstraints();
gbcScroll.gridx = 0;
gbcScroll.gridy = 1;
gbcScroll.gridwidth = 1;
gbcScroll.gridheight = 1;
gbcScroll.weightx = 0;
gbcScroll.weighty = 0;
gbcScroll.fill = GridBagConstraints.BOTH;
gbcScroll.anchor = GridBagConstraints.LINE_START;
panel.add(scroll , gbcScroll);
JOptionPane.showMessageDialog((JFrame) pluginWorkspaceAccess.getParentFrame(), panel, resourceBundle.getMessage(Tags.SHOW_REPORT_TITLE), JOptionPane.INFORMATION_MESSAGE);
}
else{
throw new IOException(resourceBundle.getMessage(Tags.SHOW_REPORT_EXCEPTION_MESSAGE));
}
}
開發者ID:oxygenxml,項目名稱:oxygen-dita-translation-package-builder,代碼行數:61,代碼來源:TranslationPackageBuilderExtension.java
示例8: JobAttributesPanel
public JobAttributesPanel() {
super();
GridBagLayout gridbag = new GridBagLayout();
GridBagConstraints c = new GridBagConstraints();
setLayout(gridbag);
setBorder(BorderFactory.createTitledBorder(strTitle));
c.fill = GridBagConstraints.NONE;
c.insets = compInsets;
c.weighty = 1.0;
cbJobSheets = createCheckBox("checkbox.jobsheets", this);
c.anchor = GridBagConstraints.LINE_START;
addToGB(cbJobSheets, this, gridbag, c);
JPanel pnlTop = new JPanel();
lblPriority = new JLabel(getMsg("label.priority"), JLabel.TRAILING);
lblPriority.setDisplayedMnemonic(getMnemonic("label.priority"));
pnlTop.add(lblPriority);
snModel = new SpinnerNumberModel(1, 1, 100, 1);
spinPriority = new JSpinner(snModel);
lblPriority.setLabelFor(spinPriority);
// REMIND
((JSpinner.NumberEditor)spinPriority.getEditor()).getTextField().setColumns(3);
spinPriority.addChangeListener(this);
pnlTop.add(spinPriority);
c.anchor = GridBagConstraints.LINE_END;
c.gridwidth = GridBagConstraints.REMAINDER;
pnlTop.getAccessibleContext().setAccessibleName(
getMsg("label.priority"));
addToGB(pnlTop, this, gridbag, c);
c.fill = GridBagConstraints.HORIZONTAL;
c.anchor = GridBagConstraints.CENTER;
c.weightx = 0.0;
c.gridwidth = 1;
char jmnemonic = getMnemonic("label.jobname");
lblJobName = new JLabel(getMsg("label.jobname"), JLabel.TRAILING);
lblJobName.setDisplayedMnemonic(jmnemonic);
addToGB(lblJobName, this, gridbag, c);
c.weightx = 1.0;
c.gridwidth = GridBagConstraints.REMAINDER;
tfJobName = new JTextField();
lblJobName.setLabelFor(tfJobName);
tfJobName.addFocusListener(this);
tfJobName.setFocusAccelerator(jmnemonic);
tfJobName.getAccessibleContext().setAccessibleName(
getMsg("label.jobname"));
addToGB(tfJobName, this, gridbag, c);
c.weightx = 0.0;
c.gridwidth = 1;
char umnemonic = getMnemonic("label.username");
lblUserName = new JLabel(getMsg("label.username"), JLabel.TRAILING);
lblUserName.setDisplayedMnemonic(umnemonic);
addToGB(lblUserName, this, gridbag, c);
c.gridwidth = GridBagConstraints.REMAINDER;
tfUserName = new JTextField();
lblUserName.setLabelFor(tfUserName);
tfUserName.addFocusListener(this);
tfUserName.setFocusAccelerator(umnemonic);
tfUserName.getAccessibleContext().setAccessibleName(
getMsg("label.username"));
addToGB(tfUserName, this, gridbag, c);
}
示例9: DialogPanel
DialogPanel() {
List<Project> projects = Projects.getOpenProjects();
Object[] options = new Object[projects.size()];
Object initialSelection = null;
for (int i = 0; i < options.length; i++) {
Project proj = projects.get(i);
options[i] = new ProjectItem(proj);
if (proj == model.getCurrentProject()) {
initialSelection = options[i];
}
}
project = new JComboBox<Object>(options);
if (options.length == 1) {
project.setSelectedItem(options[0]);
project.setEnabled(false);
} else if (initialSelection != null) {
project.setSelectedItem(initialSelection);
}
Circuit defaultCircuit = model.getCurrentCircuit();
if (defaultCircuit != null) {
name.setText(defaultCircuit.getName());
name.selectAll();
}
VariableList outputs = model.getOutputs();
boolean enableNands = true;
for (int i = 0; i < outputs.size(); i++) {
String output = outputs.get(i);
Expression expr = model.getOutputExpressions().getExpression(output);
if (expr != null && expr.containsXor()) {
enableNands = false;
break;
}
}
nands.setEnabled(enableNands);
GridBagLayout gb = new GridBagLayout();
GridBagConstraints gc = new GridBagConstraints();
setLayout(gb);
gc.anchor = GridBagConstraints.LINE_START;
gc.fill = GridBagConstraints.NONE;
gc.gridx = 0;
gc.gridy = 0;
gb.setConstraints(projectLabel, gc);
add(projectLabel);
gc.gridx = 1;
gb.setConstraints(project, gc);
add(project);
gc.gridy++;
gc.gridx = 0;
gb.setConstraints(nameLabel, gc);
add(nameLabel);
gc.gridx = 1;
gb.setConstraints(name, gc);
add(name);
gc.gridy++;
gb.setConstraints(twoInputs, gc);
add(twoInputs);
gc.gridy++;
gb.setConstraints(nands, gc);
add(nands);
projectLabel.setText(Strings.get("buildProjectLabel"));
nameLabel.setText(Strings.get("buildNameLabel"));
twoInputs.setText(Strings.get("buildTwoInputsLabel"));
nands.setText(Strings.get("buildNandsLabel"));
}
示例10: TemplateOptions
public TemplateOptions(PreferencesFrame window) {
super(window);
ButtonGroup bgroup = new ButtonGroup();
bgroup.add(plain);
bgroup.add(empty);
bgroup.add(custom);
plain.addActionListener(myListener);
empty.addActionListener(myListener);
custom.addActionListener(myListener);
templateField.setEditable(false);
templateButton.addActionListener(myListener);
myListener.computeEnabled();
GridBagLayout gridbag = new GridBagLayout();
GridBagConstraints gbc = new GridBagConstraints();
setLayout(gridbag);
gbc.weightx = 1.0;
gbc.gridx = 0;
gbc.gridy = GridBagConstraints.RELATIVE;
gbc.gridwidth = 3;
gbc.anchor = GridBagConstraints.LINE_START;
gridbag.setConstraints(plain, gbc);
add(plain);
gridbag.setConstraints(empty, gbc);
add(empty);
gridbag.setConstraints(custom, gbc);
add(custom);
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.gridwidth = 1;
gbc.gridy = 3;
gbc.gridx = GridBagConstraints.RELATIVE;
gbc.weightx = 1.0;
gridbag.setConstraints(templateField, gbc);
add(templateField);
gbc.weightx = 0.0;
gridbag.setConstraints(templateButton, gbc);
add(templateButton);
AppPreferences.addPropertyChangeListener(AppPreferences.TEMPLATE_TYPE, myListener);
AppPreferences.addPropertyChangeListener(AppPreferences.TEMPLATE_FILE, myListener);
switch (AppPreferences.getTemplateType()) {
case AppPreferences.TEMPLATE_PLAIN:
plain.setSelected(true);
break;
case AppPreferences.TEMPLATE_EMPTY:
empty.setSelected(true);
break;
case AppPreferences.TEMPLATE_CUSTOM:
custom.setSelected(true);
break;
}
myListener.setTemplateField(AppPreferences.getTemplateFile());
}