My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package org.penemunxt.projects.penemunxtexplorer.pc.map.processing;

import java.awt.*;
import java.awt.geom.AffineTransform;
import java.awt.geom.NoninvertibleTransformException;
import java.util.ArrayList;

import org.penemunxt.projects.penemunxtexplorer.RobotData;

public class MapProcessors {
ArrayList<IMapProcessor> list;

public ArrayList<IMapProcessor> getList() {
return list;
}

public void setList(ArrayList<IMapProcessor> list) {
this.list = list;
}

public MapProcessors(ArrayList<IMapProcessor> list) {
super();
this.list = list;
}

public void processData(ArrayList<RobotData> data, int maxIndex,
float scale, int centerX, int centerY, Graphics g) {
this.processData(data, scale, 0, centerX, centerY, g);
}

public void processData(ArrayList<RobotData> data, int maxIndex,
float scale, double rotate, int centerX, int centerY, Graphics g) {
if (data != null && data.size() > 0) {
ArrayList<RobotData> dataFiltered;
dataFiltered = new ArrayList<RobotData>(data.subList(0, Math.min(
maxIndex, data.size() - 1)));
this.processData(dataFiltered, scale, rotate, centerX, centerY, g);
}
}

public void processData(ArrayList<RobotData> data, float scale,
int centerX, int centerY, Graphics g) {
this.processData(data, scale, 0, centerX, centerY, g);
}

public void processData(ArrayList<RobotData> data, float scale,
double rotate, int centerX, int centerY, Graphics g) {

Graphics2D g2 = (Graphics2D) g;
g2.setTransform(MapUtilities.getMapTransform(centerX, centerY, scale, rotate));

if (list != null && list.size() > 0) {
for (IMapProcessor mapProcessor : this.getList()) {
mapProcessor.reset();
}
for (IMapProcessor mapProcessor : this.getList()) {
if (mapProcessor.isEnabled()) {
if(!mapProcessor.isAffectedByRotation()){
g2.rotate(-rotate);
}
mapProcessor.processData(data, g);
if(!mapProcessor.isAffectedByRotation()){
g2.rotate(rotate);
}
}
}
}
}
}

Change log

r292 by peterf.se on Feb 13, 2010   Diff
[No log message]
Go to: 
Project members, sign in to write a code review

Older revisions

r205 by peterf.se on Dec 31, 2009   Diff
[No log message]
r202 by peterf.se on Dec 10, 2009   Diff
[No log message]
r193 by peterf.se on Dec 6, 2009   Diff
[No log message]
All revisions of this file

File info

Size: 2062 bytes, 69 lines

File properties

svn:mime-type
text/plain
Powered by Google Project Hosting