public void intervalAdded(ListDataEvent e) { updateLayoutStateNeeded = true; int minIndex = Math.min(e.getIndex0(), e.getIndex1()); int maxIndex = Math.max(e.getIndex0(), e.getIndex1()); /* Sync the SelectionModel with the DataModel. */ ListSelectionModel sm = getSelectionModel(); if (sm != null) { sm.insertIndexInterval(minIndex, maxIndex - minIndex, true); } }
@Override public void insertIndexInterval(int index, int length, boolean before) { delegate.insertIndexInterval(index, length, before); }
@Override public void insertIndexInterval(int index, int length, boolean before) { delegate.insertIndexInterval(index, length, before); }
@Override public void insertIndexInterval(int index, int length, boolean before) { delegate.insertIndexInterval(index, length, before); }
public void insertIndexInterval(final int pIndex, final int pLength, final boolean pBefore) { mListSelectionModel.insertIndexInterval(pIndex, pLength, pBefore); handleListSelection(); }
public void insertIndexInterval(final int pIndex, final int pLength, final boolean pBefore) { mListSelectionModel.insertIndexInterval(pIndex, pLength, pBefore); handleListSelection(); }
public void insertIndexInterval(final int pIndex, final int pLength, final boolean pBefore) { mListSelectionModel.insertIndexInterval(pIndex, pLength, pBefore); handleListSelection(); }
public void intervalAdded(ListDataEvent e) { updateLayoutStateNeeded = true; int minIndex = Math.min(e.getIndex0(), e.getIndex1()); int maxIndex = Math.max(e.getIndex0(), e.getIndex1()); /* Sync the SelectionModel with the DataModel. */ ListSelectionModel sm = getSelectionModel(); if (sm != null) sm.insertIndexInterval(minIndex, maxIndex - minIndex, true); }
public void insertIndexInterval(int index, int length, boolean before) { int uindex = constraint.unconstraint(index); /* The first new index will appear at insMinIndex and the last * one will appear at insMaxIndex */ int index0 = before ? uindex : uindex + 1; int index1 = (index0 + length) - 1; index0 = constraint.unconstraint(index0); index1 = constraint.unconstraint(index1); length = index1 - index0 + 1; delegate.insertIndexInterval(before ? index0 : index0 - 1, length, before); }
public void intervalAdded(ListDataEvent e) { int minIndex = Math.min(e.getIndex0(), e.getIndex1()); int maxIndex = Math.max(e.getIndex0(), e.getIndex1()); /* Sync the SelectionModel with the DataModel. */ ListSelectionModel listSelectionModel = _list.getCheckBoxListSelectionModel(); if (listSelectionModel != null) { listSelectionModel.insertIndexInterval(minIndex, maxIndex - minIndex + 1, true); } }
public void intervalAdded(ListDataEvent e) { updateLayoutStateNeeded = true; int minIndex = Math.min(e.getIndex0(), e.getIndex1()); int maxIndex = Math.max(e.getIndex0(), e.getIndex1()); /* Sync the SelectionModel with the DataModel. */ ListSelectionModel sm = getSelectionModel(); if (sm != null) sm.insertIndexInterval(minIndex, maxIndex - minIndex, true); }
public void intervalAdded(ListDataEvent e) { updateLayoutStateNeeded = modelChanged; int minIndex = Math.min(e.getIndex0(), e.getIndex1()); int maxIndex = Math.max(e.getIndex0(), e.getIndex1()); /* Sync the SelectionModel with the DataModel. */ ListSelectionModel sm = list.getSelectionModel(); if (sm != null) { sm.insertIndexInterval(minIndex, maxIndex - minIndex+1, true); } /* Repaint the entire list, from the origin of * the first added cell, to the bottom of the * component. */ redrawList(); }
public void intervalAdded(ListDataEvent e) { updateLayoutStateNeeded = modelChanged; int minIndex = Math.min(e.getIndex0(), e.getIndex1()); int maxIndex = Math.max(e.getIndex0(), e.getIndex1()); /* Sync the SelectionModel with the DataModel. */ ListSelectionModel sm = list.getSelectionModel(); if (sm != null) { sm.insertIndexInterval(minIndex, maxIndex - minIndex+1, true); } /* Repaint the entire list, from the origin of * the first added cell, to the bottom of the * component. */ redrawList(); }
public void intervalAdded(ListDataEvent e) { updateLayoutStateNeeded = modelChanged; int minIndex = Math.min(e.getIndex0(), e.getIndex1()); int maxIndex = Math.max(e.getIndex0(), e.getIndex1()); /* Sync the SelectionModel with the DataModel. */ ListSelectionModel sm = list.getSelectionModel(); if (sm != null) { sm.insertIndexInterval(minIndex, maxIndex - minIndex+1, true); } /* Repaint the entire list, from the origin of * the first added cell, to the bottom of the * component. */ redrawList(); }
public void intervalAdded(ListDataEvent e) { updateLayoutStateNeeded = modelChanged; int minIndex = Math.min(e.getIndex0(), e.getIndex1()); int maxIndex = Math.max(e.getIndex0(), e.getIndex1()); /* Sync the SelectionModel with the DataModel. */ ListSelectionModel sm = list.getSelectionModel(); if (sm != null) { sm.insertIndexInterval(minIndex, maxIndex - minIndex+1, true); } /* Repaint the entire list, from the origin of * the first added cell, to the bottom of the * component. */ redrawList(); }
public void moveRessource(int ressourceIndex, int newIndex) { if ((ressourceIndex < 0) || (ressourceIndex >= getRessourceCount()) || (newIndex < 0) || (newIndex >= getRessourceCount())) throw new IllegalArgumentException( "moveRessource() - Index out of range"); //$NON-NLS-1$ TimelineRessource aRessource; if (ressourceIndex == newIndex) { fireRessourceMoved(new TimelineRessourceModelEvent(this, ressourceIndex, newIndex)); return; } aRessource = timelineRessources.elementAt(ressourceIndex); timelineRessources.removeElementAt(ressourceIndex); boolean selected = selectionModel.isSelectedIndex(ressourceIndex); selectionModel.removeIndexInterval(ressourceIndex, ressourceIndex); timelineRessources.insertElementAt(aRessource, newIndex); selectionModel.insertIndexInterval(newIndex, 1, true); if (selected) { selectionModel.addSelectionInterval(newIndex, newIndex); } else { selectionModel.removeSelectionInterval(newIndex, newIndex); } fireRessourceMoved(new TimelineRessourceModelEvent(this, ressourceIndex, newIndex)); }
public void moveResource(int resourceIndex, int newIndex) { if ((resourceIndex < 0) || (resourceIndex >= getResourceCount()) || (newIndex < 0) || (newIndex >= getResourceCount())) throw new IllegalArgumentException( "moveResource() - Index out of range"); //$NON-NLS-1$ SimpleTimelineResource aResource; if (resourceIndex == newIndex) { fireResourceMoved(new SimpleTimelineResourcesModelEvent(this, resourceIndex, newIndex)); return; } aResource = timelineResources.elementAt(resourceIndex); timelineResources.removeElementAt(resourceIndex); boolean selected = selectionModel.isSelectedIndex(resourceIndex); selectionModel.removeIndexInterval(resourceIndex, resourceIndex); timelineResources.insertElementAt(aResource, newIndex); selectionModel.insertIndexInterval(newIndex, 1, true); if (selected) { selectionModel.addSelectionInterval(newIndex, newIndex); } else { selectionModel.removeSelectionInterval(newIndex, newIndex); } fireResourceMoved(new SimpleTimelineResourcesModelEvent(this, resourceIndex, newIndex)); }
public void moveResource(int resourceIndex, int newIndex) { if ((resourceIndex < 0) || (resourceIndex >= getResourceCount()) || (newIndex < 0) || (newIndex >= getResourceCount())) throw new IllegalArgumentException( "moveResource() - Index out of range"); //$NON-NLS-1$ SimpleDaysTimelineResource aResource; if (resourceIndex == newIndex) { fireResourceMoved(new SimpleDaysTimelineResourcesModelEvent(this, resourceIndex, newIndex)); return; } aResource = timelineResources.elementAt(resourceIndex); timelineResources.removeElementAt(resourceIndex); boolean selected = selectionModel.isSelectedIndex(resourceIndex); selectionModel.removeIndexInterval(resourceIndex, resourceIndex); timelineResources.insertElementAt(aResource, newIndex); selectionModel.insertIndexInterval(newIndex, 1, true); if (selected) { selectionModel.addSelectionInterval(newIndex, newIndex); } else { selectionModel.removeSelectionInterval(newIndex, newIndex); } fireResourceMoved(new SimpleDaysTimelineResourcesModelEvent(this, resourceIndex, newIndex)); }
public void moveResource(int resourceIndex, int newIndex) { if ((resourceIndex < 0) || (resourceIndex >= getResourceCount()) || (newIndex < 0) || (newIndex >= getResourceCount())) throw new IllegalArgumentException( "moveResource() - Index out of range"); //$NON-NLS-1$ RoulementTimelineResource aResource; if (resourceIndex == newIndex) { fireResourceMoved(new RoulementTimelineResourcesModelEvent(this, resourceIndex, newIndex)); return; } aResource = timelineResources.elementAt(resourceIndex); timelineResources.removeElementAt(resourceIndex); boolean selected = selectionModel.isSelectedIndex(resourceIndex); selectionModel.removeIndexInterval(resourceIndex, resourceIndex); timelineResources.insertElementAt(aResource, newIndex); selectionModel.insertIndexInterval(newIndex, 1, true); if (selected) { selectionModel.addSelectionInterval(newIndex, newIndex); } else { selectionModel.removeSelectionInterval(newIndex, newIndex); } fireResourceMoved(new RoulementTimelineResourcesModelEvent(this, resourceIndex, newIndex)); }
@Override public void insertIndexInterval(int index, int length, boolean before) { super.insertIndexInterval(index, length, before); /* The first new index will appear at insMinIndex and the last * one will appear at insMaxIndex */ int index0 = before ? index : index + 1; int index1 = (index0 + length) - 1; int contentSize = informer.getContentSize(); InsetPart part0 = inset.toInnerSpace(index0, contentSize); InsetPart part1 = inset.toInnerSpace(index1, contentSize); if (part0.getKind() == InsetPart.PartKind.CONTENT || part1.getKind() == InsetPart.PartKind.CONTENT || (part0.getKind() == InsetPart.PartKind.BEFORE && part1.getKind() == InsetPart.PartKind.AFTER)) { if (part0.getKind() == InsetPart.PartKind.BEFORE) { index0 = 0; } else { index0 = part0.getValue(); } if (part1.getKind() == InsetPart.PartKind.AFTER) { index1 = contentSize - 1; } else { index1 = part1.getValue(); } length = index1 - index0 + 1; delegate.insertIndexInterval(before ? index0 : index0 - 1, length, before); }//else ... }