public void init(java.util.List<Pair<String, TextWithImports>> data) { myData.clear(); for (Iterator<Pair<String, TextWithImports>> it = data.iterator(); it.hasNext(); ) { final Pair<String, TextWithImports> pair = it.next(); myData.add(new Row(pair.getFirst(), pair.getSecond())); } }
public void emptyAll() { myLog.clear(); myCommandsProcessedCount = 0; myErrorCount = 0; myWarningCount = 0; myPlainTextView.clearAllMessages(); myTreeView.clearAllMessages(); }
public static void animationPause(int pauseTime) { if ((pauseTime < 1) || (pauseTime > 1000)) { pauseTime = 100; } try { Thread.sleep(pauseTime); synchronized (animPoints) { animPoints.clear(); } synchronized (animLines) { animLines.clear(); } synchronized (animOvals) { animOvals.clear(); } synchronized (animRectangles) { animRectangles.clear(); } } catch (InterruptedException e) { } }
/** * Runs clean-up for associated resources which need explicit disposal (e.g. listeners keeping * this instance alive because they were added to the model which operationally outlives this * instance). */ public void dispose() { GuiActivator.getUIService().removePluginComponentListener(this); /* * Explicitly remove the components of the PluginComponent instances * because the latter are registered with OSGi and are thus global. */ synchronized (this) { for (PluginComponent pluginComponent : pluginComponents) container.remove((Component) pluginComponent.getComponent()); pluginComponents.clear(); } }
public synchronized void actionPerformed(ActionEvent e) { java.util.List<JComponent> componentsToRemove = null; java.util.List<Part> partsToRemove = null; for (JComponent component : animationStateMap.keySet()) { component.repaint(); if (partsToRemove != null) { partsToRemove.clear(); } Map<Part, AnimationState> map = animationStateMap.get(component); if (!component.isShowing() || map == null || map.size() == 0) { if (componentsToRemove == null) { componentsToRemove = new ArrayList<JComponent>(); } componentsToRemove.add(component); continue; } for (Part part : map.keySet()) { if (map.get(part).isDone()) { if (partsToRemove == null) { partsToRemove = new ArrayList<Part>(); } partsToRemove.add(part); } } if (partsToRemove != null) { if (partsToRemove.size() == map.size()) { // animation is done for the component if (componentsToRemove == null) { componentsToRemove = new ArrayList<JComponent>(); } componentsToRemove.add(component); } else { for (Part part : partsToRemove) { map.remove(part); } } } } if (componentsToRemove != null) { for (JComponent component : componentsToRemove) { animationStateMap.remove(component); } } if (animationStateMap.size() == 0) { timer.stop(); } }
public void clear() { myData.clear(); fireTableDataChanged(); }