javax.swing.border.TitledBorder#setTitle ( )源码实例Demo

下面列出了javax.swing.border.TitledBorder#setTitle ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: audiveris   文件: SampleBrowser.java
protected void update ()
{
    final int selectionCount = list.getSelectedIndices().length;

    // Title
    final TitledBorder border = (TitledBorder) getBorder();
    border.setTitle(title + ((selectionCount > 0) ? (": " + selectionCount) : ""));
    repaint();

    // Buttons
    selectAll.setEnabled(model.size() > 0);
    cancelAll.setEnabled(selectionCount > 0);

    // Notify listener if any
    if (listener != null) {
        listener.stateChanged(null);
    }
}
 
源代码2 项目: jsyn   文件: DoubleBoundedRangeSlider.java
protected void updateTitle() {
    TitledBorder border = (TitledBorder) getBorder();
    if (border != null) {
        border.setTitle(generateTitleText());
        repaint();
    }
}
 
源代码3 项目: grammarviz2_src   文件: GrammarvizChartPanel.java
/**
 * Creates the chart panel, puts it on display.
 * 
 */
public void resetChartPanel() {

  // this is the new "insert" - elastic boundaries chart panel
  //
  if (null == this.session.chartData && null != this.tsData) {
    paintTheChart(this.tsData);
  }
  else {
    paintTheChart(this.session.chartData.getOriginalTimeseries());
  }

  // reset the border label
  //
  TitledBorder tb = (TitledBorder) this.getBorder();
  tb.setTitle(LABEL_DEFAULT);

  // instantiate and adjust the chart panel
  //
  chartPanel = new ChartPanel(this.chart);

  chartPanel.setMaximumDrawHeight(this.getParent().getHeight());
  chartPanel.setMaximumDrawWidth(this.getParent().getWidth());
  chartPanel.setMinimumDrawWidth(0);
  chartPanel.setMinimumDrawHeight(0);

  chartPanel.setMouseWheelEnabled(true);

  // cleanup all the content
  //
  this.removeAll();

  // put the chart on show
  //
  this.add(chartPanel);

  // make sure all is set
  //
  this.revalidate();
}
 
源代码4 项目: hortonmachine   文件: DatabaseController.java
protected void setDbTreeTitle( String title ) {
    Border databaseTreeViewBorder = _databaseTreeView.getBorder();
    if (databaseTreeViewBorder instanceof TitledBorder) {
        TitledBorder tBorder = (TitledBorder) databaseTreeViewBorder;
        tBorder.setTitle(title);
        _databaseTreeView.repaint();
        _databaseTreeView.invalidate();
    }
}
 
源代码5 项目: hortonmachine   文件: GeopaparazziController.java
protected void setDbTreeTitle( String title ) {
    Border databaseTreeViewBorder = _databaseTreeView.getBorder();
    if (databaseTreeViewBorder instanceof TitledBorder) {
        TitledBorder tBorder = (TitledBorder) databaseTreeViewBorder;
        tBorder.setTitle(title);
    }
}
 
源代码6 项目: jsyn   文件: DoubleBoundedRangeSlider.java
protected void updateTitle() {
    TitledBorder border = (TitledBorder) getBorder();
    if (border != null) {
        border.setTitle(generateTitleText());
        repaint();
    }
}
 
源代码7 项目: floobits-intellij   文件: ChatUserForm.java
public void updateBorder() {
    TitledBorder border = (TitledBorder) containerPanel.getBorder();
    String usernameStr = username;
    if (following) {
        usernameStr += "*";
    }
    border.setTitle(usernameStr);
    containerPanel.validate();
}
 
源代码8 项目: ghidra   文件: ExternalConflictInfoPanel.java
/**
 * Call this to set the phase of the Listing merge that you are in currently.
 * @param conflictType the type of conflict being resolved by this phase
 * (for example, Symbols).
 */
void setConflictType(String conflictType) {
	this.conflictType = conflictType;
	TitledBorder tBorder = (TitledBorder) getBorder();
	tBorder.setTitle("Resolve " + conflictType + " Conflict");
}
 
源代码9 项目: ghidra   文件: ConflictInfoPanel.java
/**
 * Call this to set the phase of the Listing merge that you are in currently.
 * @param conflictType the type of conflict being resolved by this phase
 * (for example, Symbols).
 */
void setConflictType(String conflictType) {
	this.conflictType = conflictType;
	TitledBorder tBorder = (TitledBorder) getBorder();
	tBorder.setTitle("Resolve " + conflictType + " Conflict");
}
 
源代码10 项目: audiveris   文件: SampleListing.java
/**
 * Empty and regenerate the whole content of SampleListing.
 *
 * @param samples the whole sequence of samples to display (assumed to be ordered by shape)
 */
void populateWith (List<Sample> samples)
{
    scrollablePanel.removeAll(); // Remove all ShapePane instances

    browser.publishSample(null); // Deselect any sample

    // Rebuild ShapePane instances as needed
    Shape currentShape = null;
    List<Sample> shapeSamples = new ArrayList<>();

    for (Sample sample : samples) {
        final Shape shape = sample.getShape();

        // End of a shape collection?
        if ((currentShape != null) && (currentShape != shape)) {
            scrollablePanel.add(new ShapePane(currentShape, shapeSamples));
            shapeSamples.clear();
        }

        currentShape = shape;
        shapeSamples.add(sample);
    }

    // Last shape
    if ((currentShape != null) && !shapeSamples.isEmpty()) {
        scrollablePanel.add(new ShapePane(currentShape, shapeSamples));
    }

    TitledBorder border = (TitledBorder) getBorder();
    int sampleCount = samples.size();
    border.setTitle(title + ((sampleCount > 0) ? (": " + sampleCount) : ""));
    validate();
    repaint();

    // Pre-select the very first sample of the very first ShapePane
    if (!samples.isEmpty()) {
        ShapePane shapePane = (ShapePane) scrollablePanel.getComponent(0);
        shapePane.list.setSelectedIndex(0);
    }
}
 
源代码11 项目: jeddict   文件: FieldTypePanel.java
private void initTypeComboBox() {
        TitledBorder titledBorder = (TitledBorder) jLayeredPane1.getBorder();
//        type_LayeredPane.setVisible(false);
        List<String> type = new ArrayList<>();
        type.add(DEFAULT);
        if (mapKey) {
            type.add(ENUMERATED);
            type.add(TEMPORAL);
            type.add(ENTITY);
            type.add(EMBEDDABLE);
            titledBorder.setTitle("MapKey Attribute");
        } else if (attribute instanceof PersistenceBaseAttribute) {
            type.add(TEMPORAL);
            if (attribute instanceof Basic) {
                type.add(ENUMERATED);
                type.add(LOB);
                titledBorder.setTitle("Basic Attribute");
            } else if (attribute instanceof Id) {
                titledBorder.setTitle("Id Attribute");
            } else if (attribute instanceof Version) {
                titledBorder.setTitle("Version Attribute");
            }
        } else if (attribute instanceof ElementCollection) {
            type.add(ENUMERATED);
            type.add(LOB);
            type.add(TEMPORAL);
            titledBorder.setTitle("ElementCollection<Basic> Attribute");
        } else if (attribute instanceof Transient) {
            titledBorder.setTitle("Transient Attribute");
        } else if (attribute instanceof BeanAttribute || attribute instanceof BeanCollectionAttribute) {
            titledBorder.setTitle("Attribute");
        }

        type_ComboBox.removeAllItems();
        type_ComboBox.setModel(new DefaultComboBoxModel(type.toArray(new String[0])));
//        if(type.size() == 1){
//            type_LayeredPane.setVisible(false);
//        }
        //ElementCollection[Basic Type Value] => Lob,Enumerated,Temporal
        //Id => Temporal
    }
 
源代码12 项目: tracker   文件: AttachmentDialog.java
/**
   * Updates this dialog to show the system's current attachments.
   */
  protected void refreshGUI() {
    setTitle(TrackerRes.getString("AttachmentInspector.Title")); //$NON-NLS-1$
    helpButton.setText(TrackerRes.getString("Dialog.Button.Help")); //$NON-NLS-1$  
    closeButton.setText(TrackerRes.getString("Dialog.Button.Close")); //$NON-NLS-1$
    dummyMass.setName(TrackerRes.getString("DynamicSystemInspector.ParticleName.None")); //$NON-NLS-1$
  	startLabel.setText(TrackerRes.getString("AttachmentInspector.Label.StartFrame")); //$NON-NLS-1$
  	countLabel.setText(TrackerRes.getString("AttachmentInspector.Label.FrameCount")); //$NON-NLS-1$
  	stepsButton.setText(TrackerRes.getString("AttachmentInspector.Button.Steps")); //$NON-NLS-1$
  	tracksButton.setText(TrackerRes.getString("AttachmentInspector.Button.Tracks")); //$NON-NLS-1$
  	relativeCheckbox.setText(TrackerRes.getString("AttachmentInspector.Checkbox.Relative")); //$NON-NLS-1$
  	stepsButton.setToolTipText(TrackerRes.getString("AttachmentInspector.Button.Steps.Tooltip")); //$NON-NLS-1$
  	tracksButton.setToolTipText(TrackerRes.getString("AttachmentInspector.Button.Tracks.Tooltip")); //$NON-NLS-1$
  	relativeCheckbox.setToolTipText(TrackerRes.getString("AttachmentInspector.Checkbox.Relative.Tooltip")); //$NON-NLS-1$
    TitledBorder border = (TitledBorder)circleFitterPanel.getBorder();
  	border.setTitle(TrackerRes.getString("AttachmentInspector.Border.Title.AttachTo")); //$NON-NLS-1$
    
  	// refresh layout to include/exclude circle fitter items
  	boolean hasCircleFitterPanel = attachmentsPanel.getComponentCount()>2;
  	boolean hasStartStopPanel = circleFitterPanel.getComponentCount()>1;
  	boolean changedLayout = false;
		TTrack measuringTool = TTrack.getTrack(trackID);
  	if (measuringTool instanceof CircleFitter) {
      // put circleFitter panel in attachments panel SOUTH
      changedLayout = !hasCircleFitterPanel;
      attachmentsPanel.add(circleFitterPanel, BorderLayout.SOUTH);

      CircleFitter fitter = (CircleFitter)measuringTool;
      if (!fitter.attachToSteps) {
        changedLayout = changedLayout || hasStartStopPanel;
        circleFitterPanel.remove(circleFitterStartStopPanel);      	
      }
      else {
      	if (fitter.isRelativeFrameNumbers) {
//      		startLabel.setText(TrackerRes.getString("AttachmentInspector.Label.Offset")); //$NON-NLS-1$
      	}
        changedLayout = changedLayout || !hasStartStopPanel;
        circleFitterPanel.add(circleFitterStartStopPanel, BorderLayout.CENTER);      	
      }
  	}
  	else {
      attachmentsPanel.remove(circleFitterPanel);
      changedLayout = hasCircleFitterPanel;
  	}
  	if (changedLayout) {
  		pack();
  	}
    repaint();
  }
 
源代码13 项目: freecol   文件: Utility.java
/**
 * Localize the a titled border.
 *
 * @param component The {@code JComponent} to localize.
 * @param template The {@code StringTemplate} to use.
 */
public static void localizeBorder(JComponent component,
                                  StringTemplate template) {
    TitledBorder tb = (TitledBorder)component.getBorder();
    tb.setTitle(Messages.message(template));
}