本文整理了Java中org.protege.editor.core.ui.view.View.addHierarchyListener()
方法的一些代码示例,展示了View.addHierarchyListener()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。View.addHierarchyListener()
方法的具体详情如下:
包路径:org.protege.editor.core.ui.view.View
类名称:View
方法名:addHierarchyListener
暂无
代码示例来源:origin: protegeproject/protege
/**
* Creates a <code>View</code> that will display the
* <code>ViewComponent</code> instantiated by the specified
* tab view plugin.
* @param plugin The <code>ViewComponentPlugin</code> that will
* be reponsible for instantiating the content of this <code>View</code>
* in the form of a <code>ViewComponent</code>.
* @param workspace The parent <code>Workspace</code>.
*/
public View(ViewComponentPlugin plugin, Workspace workspace) {
this.plugin = plugin;
this.workspace = workspace;
// Use a hierarchy listener so that we know when the view is
// shown. When the view is shown, initialised it and remove
// the hierarchy listener
addHierarchyListener(new HierarchyListener() {
public void hierarchyChanged(HierarchyEvent e) {
if (initialisedContent == false && isShowing()) {
createUI();
initialisedContent = true;
removeHierarchyListener(this);
}
}
});
additionalViewActionPlugins = new HashSet<>();
}
代码示例来源:origin: edu.stanford.protege/org.protege.editor.core.application
/**
* Creates a <code>View</code> that will display the
* <code>ViewComponent</code> instantiated by the specified
* tab view plugin.
* @param plugin The <code>ViewComponentPlugin</code> that will
* be reponsible for instantiating the content of this <code>View</code>
* in the form of a <code>ViewComponent</code>.
* @param workspace The parent <code>Workspace</code>.
*/
public View(ViewComponentPlugin plugin, Workspace workspace) {
this.plugin = plugin;
this.workspace = workspace;
// Use a hierarchy listener so that we know when the view is
// shown. When the view is shown, initialised it and remove
// the hierarchy listener
addHierarchyListener(new HierarchyListener() {
public void hierarchyChanged(HierarchyEvent e) {
if (initialisedContent == false && isShowing()) {
createUI();
initialisedContent = true;
removeHierarchyListener(this);
}
}
});
additionalViewActionPlugins = new HashSet<ViewActionPlugin>();
addedViewActions = new HashSet<ViewAction>();
}
代码示例来源:origin: org.protege/protege-editor-core-application
/**
* Creates a <code>View</code> that will display the
* <code>ViewComponent</code> instantiated by the specified
* tab view plugin.
* @param plugin The <code>ViewComponentPlugin</code> that will
* be reponsible for instantiating the content of this <code>View</code>
* in the form of a <code>ViewComponent</code>.
* @param workspace The parent <code>Workspace</code>.
*/
public View(ViewComponentPlugin plugin, Workspace workspace) {
this.plugin = plugin;
this.workspace = workspace;
// Use a hierarchy listener so that we know when the view is
// shown. When the view is shown, initialised it and remove
// the hierarchy listener
addHierarchyListener(new HierarchyListener() {
public void hierarchyChanged(HierarchyEvent e) {
if (initialisedContent == false && isShowing()) {
createUI();
initialisedContent = true;
removeHierarchyListener(this);
}
}
});
additionalViewActionPlugins = new HashSet<ViewActionPlugin>();
addedViewActions = new HashSet<ViewAction>();
}
代码示例来源:origin: org.protege/protege-editor-owl
protected void createUI() {
setLayout(new BorderLayout());
ViewComponentPlugin plugin = getViewComponentPlugin();
view = new View(plugin, editorKit.getWorkspace());
view.setPinned(true);
view.setSyncronizing(false);
view.createUI();
view.setShowViewBanner(false);
add(view);
setBorder(BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY),
BorderFactory.createEmptyBorder(2, 2, 2, 2)));
// only attach change listeners once the component is shown
// (as those that use a view component are lazilly created)
view.addHierarchyListener(new HierarchyListener(){
public void hierarchyChanged(HierarchyEvent event) {
if (!registeredListener){
addSelectionListener(new ChangeListener(){
public void stateChanged(ChangeEvent event) {
boolean valid = getSelectedObjects() != null && !getSelectedObjects().isEmpty();
for (InputVerificationStatusChangedListener l : validateListeners){
l.verifiedStatusChanged(valid);
}
isValid = valid;
}
});
registeredListener = true;
}
}
});
}
代码示例来源:origin: edu.stanford.protege/org.protege.editor.owl
protected void createUI() {
setLayout(new BorderLayout());
ViewComponentPlugin plugin = getViewComponentPlugin();
view = new View(plugin, editorKit.getWorkspace());
view.setPinned(true);
view.setSyncronizing(false);
view.createUI();
view.setShowViewBanner(false);
add(view);
setBorder(BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY),
BorderFactory.createEmptyBorder(2, 2, 2, 2)));
// only attach change listeners once the component is shown
// (as those that use a view component are lazilly created)
view.addHierarchyListener(new HierarchyListener(){
public void hierarchyChanged(HierarchyEvent event) {
if (!registeredListener){
addSelectionListener(new ChangeListener(){
public void stateChanged(ChangeEvent event) {
boolean valid = getSelectedObjects() != null && !getSelectedObjects().isEmpty();
for (InputVerificationStatusChangedListener l : validateListeners){
l.verifiedStatusChanged(valid);
}
isValid = valid;
}
});
registeredListener = true;
}
}
});
}
代码示例来源:origin: edu.stanford.protege/protege-editor-owl
protected void createUI() {
setLayout(new BorderLayout());
ViewComponentPlugin plugin = getViewComponentPlugin();
view = new View(plugin, editorKit.getWorkspace());
view.setPinned(true);
view.setSyncronizing(false);
view.createUI();
view.setShowViewBanner(false);
add(view);
// setBorder(BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY),
// BorderFactory.createEmptyBorder(2, 2, 2, 2)));
// only attach change listeners once the component is shown
// (as those that use a view component are lazilly created)
view.addHierarchyListener(event -> {
if (!registeredListener){
addSelectionListener(e -> {
boolean valid = getSelectedObjects() != null && !getSelectedObjects().isEmpty();
for (InputVerificationStatusChangedListener l : validateListeners){
l.verifiedStatusChanged(valid);
}
isValid = valid;
});
registeredListener = true;
}
});
}
代码示例来源:origin: protegeproject/protege
protected void createUI() {
setLayout(new BorderLayout());
ViewComponentPlugin plugin = getViewComponentPlugin();
view = new View(plugin, editorKit.getWorkspace());
view.setPinned(true);
view.setSyncronizing(false);
view.createUI();
view.setShowViewBanner(false);
add(view);
// setBorder(BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY),
// BorderFactory.createEmptyBorder(2, 2, 2, 2)));
// only attach change listeners once the component is shown
// (as those that use a view component are lazilly created)
view.addHierarchyListener(event -> {
if (!registeredListener){
addSelectionListener(e -> {
boolean valid = getSelectedObjects() != null && !getSelectedObjects().isEmpty();
for (InputVerificationStatusChangedListener l : validateListeners){
l.verifiedStatusChanged(valid);
}
isValid = valid;
});
registeredListener = true;
}
});
}
内容来源于网络,如有侵权,请联系作者删除!