下面列出了javax.swing.JPanel#getClientProperty ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
public HelpCtx getHelpCtx() {
ProfilerFeature selected = featuresView == null ? null :
featuresView.getSelectedFeature();
JPanel selectedUI = selected == null ? null : selected.getResultsUI();
if (selectedUI == null && selected != null) selectedUI = selected.getSettingsUI();
String helpCtx = selectedUI == null ? null :
(String)selectedUI.getClientProperty("HelpCtx.Key"); // NOI18N
if (helpCtx == null) helpCtx = "ProfileWindow.HelpCtx"; // NOI18N
return new HelpCtx(helpCtx);
}
public HelpCtx getHelpCtx() {
ProfilerFeature selected = featuresView == null ? null :
featuresView.getSelectedFeature();
JPanel selectedUI = selected == null ? null : selected.getResultsUI();
if (selectedUI == null && selected != null) selectedUI = selected.getSettingsUI();
String helpCtx = selectedUI == null ? null :
(String)selectedUI.getClientProperty("HelpCtx.Key"); // NOI18N
if (helpCtx == null) helpCtx = "ProfileWindow.HelpCtx"; // NOI18N
return new HelpCtx(helpCtx);
}
private Outline getOutline(JPanel c, boolean ideal) {
String key = ideal ? PROPERTY_CACHED_SCRATCH_OUTLINE
: PROPERTY_CACHED_REAL_OUTLINE;
Outline outline = (Outline) c.getClientProperty(key);
int effectiveWidth = ideal ? 1000 : c.getWidth();
int effectiveHeight = ideal ? 1000 : c.getHeight();
if (outline == null
|| !outline.isValid(effectiveWidth, effectiveHeight)) {
outline = new Outline(effectiveWidth, effectiveHeight);
c.putClientProperty(key, outline);
}
return outline;
}
@Override
protected JPanel initMainPanel()
{
//Get information for main design layout and load them up
List<TopLevel> topLevelObjs = new ArrayList<TopLevel>();
if(showRootDefs.isSelected() && showCompDefs.isSelected())
{
topLevelObjs.addAll(sbolDesigns.getRootComponentDefinitions());
}
if(showRootDefs.isSelected() && showModDefs.isSelected())
{
topLevelObjs.addAll(sbolDesigns.getRootModuleDefinitions());
}
//Show an a list of designs user can choose from
TopLevelTableModel tableModel = new TopLevelTableModel(topLevelObjs);
JPanel panel = createTablePanel(tableModel, "Select Design(s) (" + tableModel.getRowCount() + ")");
table = (JTable) panel.getClientProperty("table");
table.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
tableLabel = (JLabel) panel.getClientProperty("label");
updateTable();
return panel;
}
public final ProfilerFeature getSelectedFeature() {
if (tabs == null) return null;
JPanel container = (JPanel)tabs.getSelectedComponent();
return (ProfilerFeature)container.getClientProperty(ProfilerFeature.class);
}
public final ProfilerFeature getSelectedFeature() {
if (tabs == null) return null;
JPanel container = (JPanel)tabs.getSelectedComponent();
return (ProfilerFeature)container.getClientProperty(ProfilerFeature.class);
}