/** sorts the children decreasing by their weight */ public void sortByWeights() { cacheMulti.clear(); sortBy( new Comparator<ARankColumnModel>() { @Override public int compare(ARankColumnModel o1, ARankColumnModel o2) { // return -Float.compare((float) o1.getParentData(), (float) o2.getParentData()); return Float.compare((float) o2.getParentData(), (float) o1.getParentData()); } }); }
@Override protected void init(ARankColumnModel model) { super.init(model); model.addPropertyChangeListener(PROP_WIDTH, listener); model.addPropertyChangeListener(IFilterColumnMixin.PROP_FILTER, listener); model.addPropertyChangeListener(IMappedColumnMixin.PROP_MAPPING, listener); // addDirectWeight(model.getWeight()); cacheMulti.clear(); float oldWidth = size() == 1 ? (getSpaces() - RenderStyle.COLUMN_SPACE) : width; super.setWidth(oldWidth + model.getWidth() + RenderStyle.COLUMN_SPACE); model.setParentData(model.getWidth()); }
@Override protected void takeDown(ARankColumnModel model) { super.takeDown(model); model.removePropertyChangeListener(PROP_WIDTH, listener); model.removePropertyChangeListener(IFilterColumnMixin.PROP_FILTER, listener); model.removePropertyChangeListener(IMappedColumnMixin.PROP_MAPPING, listener); // addDirectWeight(-model.getWeight()); if (alignmentDetails > size() - 2) { setAlignment(alignmentDetails - 1); } super.setWidth(width - model.getWidth() - RenderStyle.COLUMN_SPACE); model.setParentData(null); cacheMulti.clear(); }
@Override protected void moved(int from, int to) { cacheMulti.clear(); super.moved(from, to); }