summaryrefslogtreecommitdiff
path: root/src/de/lmu/ifi/dbs/elki/visualization/visualizers/pairsegments/SegmentsStylingPolicy.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/de/lmu/ifi/dbs/elki/visualization/visualizers/pairsegments/SegmentsStylingPolicy.java')
-rw-r--r--src/de/lmu/ifi/dbs/elki/visualization/visualizers/pairsegments/SegmentsStylingPolicy.java22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/de/lmu/ifi/dbs/elki/visualization/visualizers/pairsegments/SegmentsStylingPolicy.java b/src/de/lmu/ifi/dbs/elki/visualization/visualizers/pairsegments/SegmentsStylingPolicy.java
index 0ea700c8..4dc35180 100644
--- a/src/de/lmu/ifi/dbs/elki/visualization/visualizers/pairsegments/SegmentsStylingPolicy.java
+++ b/src/de/lmu/ifi/dbs/elki/visualization/visualizers/pairsegments/SegmentsStylingPolicy.java
@@ -4,7 +4,7 @@ package de.lmu.ifi.dbs.elki.visualization.visualizers.pairsegments;
This file is part of ELKI:
Environment for Developing KDD-Applications Supported by Index-Structures
- Copyright (C) 2012
+ Copyright (C) 2013
Ludwig-Maximilians-Universität München
Lehr- und Forschungseinheit für Datenbanksysteme
ELKI Development Team
@@ -56,12 +56,12 @@ public class SegmentsStylingPolicy implements ClassStylingPolicy, Result {
/**
* Selected segments
*/
- protected ArrayList<Segment> selectedSegments = new ArrayList<Segment>();
+ protected ArrayList<Segment> selectedSegments = new ArrayList<>();
/**
* Segments indirectly selected
*/
- protected TreeMap<Segment, Segment> indirectSelections = new TreeMap<Segment, Segment>();
+ protected TreeMap<Segment, Segment> indirectSelections = new TreeMap<>();
/**
* Not selected IDs that will be drawn in default colors.
@@ -165,6 +165,20 @@ public class SegmentsStylingPolicy implements ClassStylingPolicy, Result {
return (ids != null) ? ids.iter() : DBIDUtil.EMPTYDBIDS.iter();
}
+ @Override
+ public int classSize(int cnum) {
+ // unselected
+ if(cnum == -2) {
+ return unselectedObjects.size();
+ }
+ else if(cnum == -1) {
+ return 0;
+ }
+ // colors
+ DBIDs ids = selectedSegments.get(cnum).getDBIDs();
+ return (ids != null) ? ids.size() : 0;
+ }
+
/**
* Adds or removes the given segment to the selection. Depending on the
* clustering and cluster selected and the addToSelection option given, the
@@ -239,7 +253,7 @@ public class SegmentsStylingPolicy implements ClassStylingPolicy, Result {
*/
protected void deselectSegment(Segment segment) {
if(segment.isUnpaired()) {
- ArrayList<Segment> remove = new ArrayList<Segment>();
+ ArrayList<Segment> remove = new ArrayList<>();
// remove all object segments associated with unpaired segment from
// selection list
for(Entry<Segment, Segment> entry : indirectSelections.entrySet()) {