本文整理汇总了Java中javax.swing.event.AncestorEvent类的典型用法代码示例。如果您正苦于以下问题:Java AncestorEvent类的具体用法?Java AncestorEvent怎么用?Java AncestorEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AncestorEvent类属于javax.swing.event包,在下文中一共展示了AncestorEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ancestorAdded
import javax.swing.event.AncestorEvent; //导入依赖的package包/类
@Override
public void ancestorAdded(AncestorEvent event) {
ExplorerManager em = ExplorerManager.find(treeView);
em.addPropertyChangeListener(this);
if (dividerSet) {
if (lastDividerLoc != 0) {
EventQueue.invokeLater(new Runnable() {
@Override
public void run () {
diffView.setDividerLocation(lastDividerLoc);
}
});
}
} else {
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
dividerSet = true;
diffView.setDividerLocation(0.33);
}
});
}
}
示例2: initListeners
import javax.swing.event.AncestorEvent; //导入依赖的package包/类
private void initListeners() {
myRefreshButton.addActionListener(new RefreshActionListener());
myCoursesComboBox.addActionListener(new CourseSelectedListener());
setupBrowseButton();
addAncestorListener(new AncestorListenerAdapter() {
@Override
public void ancestorMoved(AncestorEvent event) {
if (!isComboboxInitialized && isVisible()) {
isComboboxInitialized = true;
initCoursesCombobox();
}
Course selectedCourse = (Course)myCoursesComboBox.getSelectedItem();
if (selectedCourse == null || selectedCourse.equals(Course.INVALID_COURSE)) {
setError(CONNECTION_ERROR);
}
}
});
}
示例3: ancestorAdded
import javax.swing.event.AncestorEvent; //导入依赖的package包/类
@Override
public void ancestorAdded(AncestorEvent event) {
//need to move fill into EDT but also direct call cause lock
//this way code is called after panel is initialized and is added
//see also 204327
RequestProcessor.getDefault().post(new Runnable() {
@Override
public void run() {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
fillDatabaseTable();
}
});
}
});
removeAncestorListener(this);
}
示例4: ancestorAdded
import javax.swing.event.AncestorEvent; //导入依赖的package包/类
@Override
public void ancestorAdded(AncestorEvent event) {
clusterNumberField.setText(Integer.toString(clusterNumber));
if (datasetBox.getSelectedIndex() != datasetIndex) {
datasetBox.setSelectedIndex(datasetIndex);
remove(canvas);
if (dataset[datasetIndex].length < 500) {
pointLegend = 'o';
} else {
pointLegend = '.';
}
canvas = ScatterPlot.plot(dataset[datasetIndex], pointLegend);
add(canvas, BorderLayout.CENTER);
validate();
}
}
示例5: ancestorAdded
import javax.swing.event.AncestorEvent; //导入依赖的package包/类
@Override
public void ancestorAdded(AncestorEvent event) {
clusterNumberField.setText(Integer.toString(clusterNumber));
if (datasetBox.getSelectedIndex() != datasetIndex) {
datasetBox.setSelectedIndex(datasetIndex);
remove(canvas);
if (dataset[datasetIndex].length < 500) {
pointLegend = 'o';
} else {
pointLegend = '.';
}
canvas = ScatterPlot.plot(dataset[datasetIndex], pointLegend);
add(canvas, BorderLayout.CENTER);
validate();
}
}
示例6: ancestorAdded
import javax.swing.event.AncestorEvent; //导入依赖的package包/类
@Override
public void ancestorAdded(AncestorEvent event) {
if (datasetBox.getSelectedIndex() != datasetIndex) {
datasetBox.setSelectedIndex(datasetIndex);
double[][] data = dataset[datasetIndex].toArray(new double[dataset[datasetIndex].size()][]);
int[] label = dataset[datasetIndex].toArray(new int[dataset[datasetIndex].size()]);
PlotCanvas canvas = ScatterPlot.plot(data, 'o');
for (int i = 0; i < data.length; i++) {
canvas.point('o', Palette.COLORS[label[i]], data[i]);
}
BorderLayout layout = (BorderLayout) getLayout();
remove(layout.getLayoutComponent(BorderLayout.CENTER));
add(canvas, BorderLayout.CENTER);
validate();
}
}
示例7: ancestorAdded
import javax.swing.event.AncestorEvent; //导入依赖的package包/类
@Override
public void ancestorAdded(AncestorEvent evt) {
final JComponent component = evt.getComponent();
component.requestFocusInWindow();
// for macOS:
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
component.requestFocusInWindow();
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
component.requestFocusInWindow();
}
});
}
});
}
示例8: ancestorAdded
import javax.swing.event.AncestorEvent; //导入依赖的package包/类
@Override
public void ancestorAdded(AncestorEvent event) {
Item item = item(event.getComponent());
if (item.runningTimer != null) {
item.runningTimer.stop();
item.runningTimer = null;
}
itemMadeDisplayable(item);
}
示例9: ancestorRemoved
import javax.swing.event.AncestorEvent; //导入依赖的package包/类
@Override
public void ancestorRemoved(AncestorEvent event) {
if (dividerSet) {
lastDividerLoc = diffView.getDividerLocation();
}
ExplorerManager em = ExplorerManager.find(treeView);
em.removePropertyChangeListener(this);
}
示例10: ancestorRemoved
import javax.swing.event.AncestorEvent; //导入依赖的package包/类
@Override
public void ancestorRemoved(AncestorEvent event) {
if (dividerSet) {
lastDividerLoc = diffView.getDividerLocation();
}
ExplorerManager em = ExplorerManager.find(treeView);
em.removePropertyChangeListener(this);
cancelBackgroundTasks();
}
示例11: ancestorAdded
import javax.swing.event.AncestorEvent; //导入依赖的package包/类
@Override
public void ancestorAdded(AncestorEvent event) {
if (!displayed) {
displayed = true;
setDefaultColumnSizes();
}
}
示例12: ancestorAdded
import javax.swing.event.AncestorEvent; //导入依赖的package包/类
@Override
public void ancestorAdded(AncestorEvent e) {
JComponent component = e.getComponent();
component.requestFocusInWindow();
if (removeListener)
component.removeAncestorListener(this);
}
示例13: ancestorAdded
import javax.swing.event.AncestorEvent; //导入依赖的package包/类
@Override
public void ancestorAdded(AncestorEvent e)
{
JComponent component = e.getComponent();
component.requestFocusInWindow();
if (removeListener)
component.removeAncestorListener(this);
}
示例14: ancestorAdded
import javax.swing.event.AncestorEvent; //导入依赖的package包/类
@Override
public void ancestorAdded(AncestorEvent event) {
initSubComponents();
removeAncestorListener(this);
}
示例15: ancestorAdded
import javax.swing.event.AncestorEvent; //导入依赖的package包/类
@Override
public void ancestorAdded(AncestorEvent event) {
initLater();
removeAncestorListener(this);
}