/
LayeredDisplayData.java
1349 lines (1147 loc) · 33 KB
/
LayeredDisplayData.java
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*******************************************************************************************************
*
* LayeredDisplayData.java, in msi.gama.core, is part of the source code of the GAMA modeling and simulation platform
* (v.1.8.2).
*
* (c) 2007-2021 UMI 209 UMMISCO IRD/SU & Partners (IRIT, MIAT, TLU, CTU)
*
* Visit https://github.com/gama-platform/gama for license information and contacts.
*
********************************************************************************************************/
package msi.gama.outputs;
import java.awt.Color;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArraySet;
import msi.gama.common.geometry.Envelope3D;
import msi.gama.common.geometry.ICoordinates;
import msi.gama.common.interfaces.IKeyword;
import msi.gama.common.preferences.GamaPreferences;
import msi.gama.common.preferences.IPreferenceChangeListener.IPreferenceAfterChangeListener;
import msi.gama.kernel.experiment.ExperimentAgent;
import msi.gama.kernel.simulation.SimulationAgent;
import msi.gama.metamodel.shape.GamaPoint;
import msi.gama.runtime.IScope;
import msi.gama.util.GamaColor;
import msi.gama.util.GamaListFactory;
import msi.gaml.descriptions.IDescription;
import msi.gaml.descriptions.ModelDescription;
import msi.gaml.expressions.IExpression;
import msi.gaml.operators.Cast;
import msi.gaml.statements.Facets;
import msi.gaml.types.Types;
import ummisco.gama.dev.utils.DEBUG;
/**
*/
public class LayeredDisplayData {
static {
DEBUG.OFF();
}
/**
* The Enum Changes.
*/
public enum Changes {
/** The split layer. */
SPLIT_LAYER,
/** The change camera. */
CHANGE_CAMERA,
/** The camera pos. */
CAMERA_POS,
/** The camera target. */
CAMERA_TARGET,
/** The camera orientation. */
CAMERA_ORIENTATION,
/** The camera preset. */
CAMERA_PRESET,
/** The background. */
BACKGROUND,
/** The highlight. */
HIGHLIGHT,
/** The zoom. */
ZOOM,
/** The keystone. */
KEYSTONE,
/** The antialias. */
ANTIALIAS,
/** The rotation. */
ROTATION;
}
/** The Constant JAVA2D. */
public static final String JAVA2D = "java2D";
/** The Constant OPENGL. */
public static final String OPENGL = "opengl";
/** The Constant OPENGL2. */
public static final String OPENGL2 = "opengl2";
/** The Constant WEB. */
public static final String WEB = "web";
/** The Constant THREED. */
public static final String THREED = "3D";
/** The Constant INITIAL_ZOOM. */
public static final Double INITIAL_ZOOM = 1.0;
/**
* The listener interface for receiving displayData events. The class that is interested in processing a displayData
* event implements this interface, and the object created with that class is registered with a component using the
* component's <code>addDisplayDataListener<code> method. When the displayData event occurs, that object's
* appropriate method is invoked.
*
* @see DisplayDataEvent
*/
public interface DisplayDataListener {
/**
* Changed.
*
* @param property
* the property
* @param value
* the value
*/
void changed(Changes property, Object value);
}
/** The listeners. */
public final Set<DisplayDataListener> listeners = new CopyOnWriteArraySet<>();
/**
* Adds the listener.
*
* @param listener
* the listener
*/
public void addListener(final DisplayDataListener listener) {
listeners.add(listener);
}
/**
* Removes the listener.
*
* @param listener
* the listener
*/
public void removeListener(final DisplayDataListener listener) {
listeners.remove(listener);
}
/**
* Notify listeners.
*
* @param property
* the property
* @param value
* the value
*/
public void notifyListeners(final Changes property, final Object value) {
for (final DisplayDataListener listener : listeners) { listener.changed(property, value); }
}
/**
* Colors
*/
private GamaColor backgroundColor = GamaPreferences.Displays.CORE_BACKGROUND.getValue();
/** The ambient color. */
private GamaColor ambientColor = new GamaColor(64, 64, 64, 255);
/** The highlight color. */
private GamaColor highlightColor = GamaPreferences.Displays.CORE_HIGHLIGHT.getValue();
/** The toolbar color. */
private GamaColor toolbarColor = null;
/**
* Properties
*/
private boolean isAutosaving = false;
/** The autosaving path. */
private String autosavingPath = "";
/** The is toolbar visible. */
private boolean isToolbarVisible = GamaPreferences.Displays.CORE_DISPLAY_TOOLBAR.getValue();
/** The is synchronized. */
private boolean isSynchronized = GamaPreferences.Runtime.CORE_SYNC.getValue();
/** The display type. */
private String displayType =
JAVA2D.equalsIgnoreCase(GamaPreferences.Displays.CORE_DISPLAY.getValue()) ? JAVA2D : OPENGL;
/** The env width. */
private double envWidth = 0d;
/** The env height. */
private double envHeight = 0d;
/** The is antialiasing. */
private boolean isAntialiasing = GamaPreferences.Displays.CORE_ANTIALIAS.getValue();
/** The image dimension. */
private GamaPoint imageDimension = new GamaPoint(-1, -1);
/** The zoom level. */
private Double zoomLevel = INITIAL_ZOOM;
/** The lights. */
private final LightPropertiesStructure lights[] = new LightPropertiesStructure[8];
/** The Constant KEYSTONE_IDENTITY. */
public static final ICoordinates KEYSTONE_IDENTITY =
ICoordinates.ofLength(4).setTo(0d, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0);
/** The keystone. */
private final ICoordinates keystone = (ICoordinates) KEYSTONE_IDENTITY.clone();
/** The z rotation angle delta. */
private double zRotationAngleDelta = 0;
/** The current rotation about Z. */
private double currentRotationAboutZ = 0;
/** The is open GL. */
private boolean isOpenGL;
/**
* OpenGL
*/
private boolean isWireframe = false;
/** The ortho. */
private boolean ortho = false;
/** The disable camera interaction. */
private boolean disableCameraInteraction = false; // "fixed_camera" facet
/** The is showing FPS. */
private boolean isShowingFPS = false; // GamaPreferences.CORE_SHOW_FPS.getValue();
/** The is drawing environment. */
private boolean isDrawingEnvironment = GamaPreferences.Displays.CORE_DRAW_ENV.getValue();
/** The is light on. */
private boolean isLightOn = true; // GamaPreferences.CORE_IS_LIGHT_ON.getValue();
/** The camera pos. */
private GamaPoint cameraPos = null;
/** The camera look pos. */
private GamaPoint cameraLookPos = null;
/** The camera orientation. */
private GamaPoint cameraOrientation = null;
/** The preset camera. */
private String presetCamera = "";
/** The camera lens. */
private int cameraLens = 45;
/** The split distance. */
private Double splitDistance;
/** The is rotating. */
private boolean isRotating;
/** The is using arc ball camera. */
private boolean isUsingArcBallCamera = true;
/** The is splitting layers. */
private boolean isSplittingLayers;
/** The constant background. */
private boolean constantBackground = true;
/** The constant ambient light. */
private boolean constantAmbientLight = true;
/** The constant camera. */
private boolean constantCamera = true;
/** The constant camera look. */
private boolean constantCameraLook = true;
/** The z near. */
private double zNear = -1.0;
/** The z far. */
private double zFar = -1.0;
/**
* Overlay
*/
// private boolean isDisplayingScale = GamaPreferences.Displays.CORE_SCALE.getValue();
private int fullScreen = -1;
/**
*
*/
IPreferenceAfterChangeListener<GamaColor> highlightListener = this::setHighlightColor;
/**
* Instantiates a new layered display data.
*/
public LayeredDisplayData() {
GamaPreferences.Displays.CORE_HIGHLIGHT.addChangeListener(highlightListener);
}
/**
* Dispose.
*/
public void dispose() {
GamaPreferences.Displays.CORE_HIGHLIGHT.removeChangeListener(highlightListener);
listeners.clear();
}
/**
* @return the backgroundColor
*/
public GamaColor getBackgroundColor() { return backgroundColor; }
/**
* @param backgroundColor
* the backgroundColor to set
*/
public void setBackgroundColor(final GamaColor backgroundColor) {
this.backgroundColor = backgroundColor;
notifyListeners(Changes.BACKGROUND, backgroundColor);
}
/**
* @return the autosave
*/
public boolean isAutosave() { return isAutosaving; }
/**
* @param autosave
* the autosave to set
*/
public void setAutosave(final boolean autosave) { this.isAutosaving = autosave; }
/**
* Sets the autosave path.
*
* @param p
* the new autosave path
*/
public void setAutosavePath(final String p) { this.autosavingPath = p; }
/**
* Gets the autosave path.
*
* @return the autosave path
*/
public String getAutosavePath() { return autosavingPath; }
/**
* Checks if is wireframe.
*
* @return true, if is wireframe
*/
public boolean isWireframe() { return isWireframe; }
/**
* Sets the wireframe.
*
* @param t
* the new wireframe
*/
public void setWireframe(final boolean t) { isWireframe = t; }
/**
* @return the ortho
*/
public boolean isOrtho() { return ortho; }
/**
* @param ortho
* the ortho to set
*/
public void setOrtho(final boolean ortho) { this.ortho = ortho; }
// /**
// * @return the displayScale
// */
// public boolean isDisplayScale() {
// return isDisplayingScale;
// }
// /**
// * @param displayScale
// * the displayScale to set
// */
// public void setDisplayScale(final boolean displayScale) {
// this.isDisplayingScale = displayScale;
// }
/**
* @return the showfps
*/
public boolean isShowfps() { return isShowingFPS; }
/**
* @param showfps
* the showfps to set
*/
public void setShowfps(final boolean showfps) { this.isShowingFPS = showfps; }
/**
* Gets the z near.
*
* @return the z near
*/
public double getzNear() {
return zNear;
}
/**
* Gets the z far.
*
* @return the z far
*/
public double getzFar() {
return zFar;
}
/**
* @return the drawEnv
*/
public boolean isDrawEnv() { return isDrawingEnvironment; }
/**
* @param drawEnv
* the drawEnv to set
*/
public void setDrawEnv(final boolean drawEnv) { this.isDrawingEnvironment = drawEnv; }
/**
* @return the isLightOn
*/
public boolean isLightOn() { return isLightOn; }
/**
* @param isLightOn
* the isLightOn to set
*/
public void setLightOn(final boolean isLightOn) { this.isLightOn = isLightOn; }
/**
* Gets the diffuse lights.
*
* @return the diffuse lights
*/
// Change lights to a possibly null structure instead of generating an array for each data
public List<LightPropertiesStructure> getDiffuseLights() {
final ArrayList<LightPropertiesStructure> result = new ArrayList<>();
for (final LightPropertiesStructure lightProp : lights) {
if (lightProp != null) {
// TODO : check if the light is active
result.add(lightProp);
}
}
return result;
}
/**
* Sets the light active.
*
* @param lightId
* the light id
* @param value
* the value
*/
public void setLightActive(final int lightId, final boolean value) {
if (lights[lightId] == null) { lights[lightId] = new LightPropertiesStructure(); }
lights[lightId].id = lightId;
lights[lightId].active = value;
}
/**
* Sets the light type.
*
* @param lightId
* the light id
* @param type
* the type
*/
public void setLightType(final int lightId, final String type) {
if (type.compareTo("direction") == 0) {
lights[lightId].type = LightPropertiesStructure.TYPE.DIRECTION;
} else if (type.compareTo("point") == 0) {
lights[lightId].type = LightPropertiesStructure.TYPE.POINT;
} else {
lights[lightId].type = LightPropertiesStructure.TYPE.SPOT;
}
}
/**
* Sets the light position.
*
* @param lightId
* the light id
* @param position
* the position
*/
public void setLightPosition(final int lightId, final GamaPoint position) {
lights[lightId].position = position;
}
/**
* Sets the light direction.
*
* @param lightId
* the light id
* @param direction
* the direction
*/
public void setLightDirection(final int lightId, final GamaPoint direction) {
lights[lightId].direction = direction;
}
/**
* Sets the diffuse light color.
*
* @param lightId
* the light id
* @param color
* the color
*/
public void setDiffuseLightColor(final int lightId, final GamaColor color) {
lights[lightId].color = color;
}
/**
* Sets the spot angle.
*
* @param lightId
* the light id
* @param angle
* the angle
*/
public void setSpotAngle(final int lightId, final float angle) {
lights[lightId].spotAngle = angle;
}
/**
* Sets the linear attenuation.
*
* @param lightId
* the light id
* @param linearAttenuation
* the linear attenuation
*/
public void setLinearAttenuation(final int lightId, final float linearAttenuation) {
lights[lightId].linearAttenuation = linearAttenuation;
}
/**
* Sets the quadratic attenuation.
*
* @param lightId
* the light id
* @param quadraticAttenuation
* the quadratic attenuation
*/
public void setQuadraticAttenuation(final int lightId, final float quadraticAttenuation) {
lights[lightId].quadraticAttenuation = quadraticAttenuation;
}
/**
* Sets the draw light.
*
* @param lightId
* the light id
* @param value
* the value
*/
public void setDrawLight(final int lightId, final boolean value) {
lights[lightId].drawLight = value;
}
/**
* Disable camera interactions.
*
* @param disableCamInteract
* the disable cam interact
*/
public void disableCameraInteractions(final boolean disableCamInteract) {
this.disableCameraInteraction = disableCamInteract;
}
/**
* Camera interaction disabled.
*
* @return true, if successful
*/
public boolean cameraInteractionDisabled() {
return disableCameraInteraction;
}
/**
* @return the ambientLightColor
*/
public Color getAmbientLightColor() { return ambientColor; }
/**
* @param ambientLightColor
* the ambientLightColor to set
*/
public void setAmbientLightColor(final GamaColor ambientLightColor) { this.ambientColor = ambientLightColor; }
/**
* Checks if is camera pos defined.
*
* @return true, if is camera pos defined
*/
public boolean isCameraPosDefined() { return cameraPos != null; }
/**
* Checks if is camera look at defined.
*
* @return true, if is camera look at defined
*/
public boolean isCameraLookAtDefined() { return cameraLookPos != null; }
/**
* Checks if is camera up vector defined.
*
* @return true, if is camera up vector defined
*/
public boolean isCameraUpVectorDefined() { return getCameraOrientation() != null; }
/**
* @return the cameraPos
*/
public GamaPoint getCameraPos() { return cameraPos; }
/**
* @param cameraPos
* the cameraPos to set
*/
public void setCameraPos(final GamaPoint point) {
if (point == null) return;
final GamaPoint c = point;
if (cameraPos != null) {
if (c.equals(cameraPos)) return;
cameraPos.setLocation(c);
} else {
cameraPos = new GamaPoint(c);
}
notifyListeners(Changes.CAMERA_POS, cameraPos);
}
/**
* @return the cameraLookPos
*/
public GamaPoint getCameraTarget() { return cameraLookPos; }
/**
* @param cameraLookPos
* the cameraLookPos to set
*/
public void setCameraLookPos(final GamaPoint point) {
if (point == null) return;
final GamaPoint c = point;
if (cameraLookPos != null) {
if (c.equals(cameraLookPos)) return;
cameraLookPos.setLocation(c);
} else {
cameraLookPos = new GamaPoint(c);
}
notifyListeners(Changes.CAMERA_TARGET, cameraLookPos);
}
/**
* @return the cameraUpVector
*/
public GamaPoint getCameraOrientation() { return cameraOrientation; }
/**
* @param cameraOrientation
* the cameraUpVector to set
*/
public void setCameraOrientation(final GamaPoint point) {
if (point == null) return;
final GamaPoint c = point;
if (cameraOrientation != null) {
if (c.equals(cameraOrientation)) return;
cameraOrientation.setLocation(c);
} else {
cameraOrientation = new GamaPoint(c);
}
notifyListeners(Changes.CAMERA_ORIENTATION, cameraOrientation);
}
/**
* @return the cameraLens
*/
public int getCameralens() { return cameraLens; }
/**
* @param cameraLens
* the cameraLens to set
*/
public void setCameraLens(final int cameraLens) {
if (this.cameraLens != cameraLens) { this.cameraLens = cameraLens; }
}
/**
* @return the displayType
*/
public String getDisplayType() { return displayType; }
/**
* @param displayType
* the displayType to set
*/
public void setDisplayType(final String displayType) {
this.displayType = displayType;
isOpenGL = OPENGL.equals(displayType) || THREED.equals(displayType) || OPENGL2.equals(displayType);
}
/**
* @return the imageDimension
*/
public GamaPoint getImageDimension() { return imageDimension; }
/**
* @param imageDimension
* the imageDimension to set
*/
public void setImageDimension(final GamaPoint imageDimension) { this.imageDimension = imageDimension; }
/**
* @return the envWidth
*/
public double getEnvWidth() { return envWidth; }
/**
* @param envWidth
* the envWidth to set
*/
public void setEnvWidth(final double envWidth) { this.envWidth = envWidth; }
/**
* @return the envHeight
*/
public double getEnvHeight() { return envHeight; }
/**
* @param envHeight
* the envHeight to set
*/
public void setEnvHeight(final double envHeight) { this.envHeight = envHeight; }
/**
* Gets the max env dim.
*
* @return the max env dim
*/
public double getMaxEnvDim() { return envWidth > envHeight ? envWidth : envHeight; }
/**
* @return
*/
public GamaColor getHighlightColor() { return highlightColor; }
/**
* Sets the highlight color.
*
* @param hc
* the new highlight color
*/
public void setHighlightColor(final GamaColor hc) {
highlightColor = hc;
notifyListeners(Changes.HIGHLIGHT, highlightColor);
}
/**
* Checks if is antialias.
*
* @return true, if is antialias
*/
public boolean isAntialias() { return isAntialiasing; }
/**
* Sets the antialias.
*
* @param a
* the new antialias
*/
public void setAntialias(final boolean a) {
isAntialiasing = a;
notifyListeners(Changes.ANTIALIAS, a);
}
/**
* @return
*/
public boolean isContinuousRotationOn() { return isRotating; }
/**
* Sets the continuous rotation.
*
* @param r
* the new continuous rotation
*/
public void setContinuousRotation(final boolean r) {
isRotating = r;
if (r && zRotationAngleDelta == 0) { zRotationAngleDelta = 0.2; }
if (!r) { zRotationAngleDelta = 0; }
}
/**
* Gets the current rotation about Z.
*
* @return the current rotation about Z
*/
public double getCurrentRotationAboutZ() { return currentRotationAboutZ; }
/**
* Sets the z rotation angle.
*
* @param val
* the new z rotation angle
*/
public void setZRotationAngle(final double val) {
zRotationAngleDelta = val;
currentRotationAboutZ = val;
// notifyListeners(Changes.ROTATION, val);
}
/**
* Increment Z rotation.
*/
public void incrementZRotation() {
currentRotationAboutZ += zRotationAngleDelta;
}
/**
* Reset Z rotation.
*/
public void resetZRotation() {
currentRotationAboutZ = zRotationAngleDelta;
}
/**
* @return
*/
public boolean isArcBallCamera() { return isUsingArcBallCamera; }
/**
* Sets the arc ball camera.
*
* @param c
* the new arc ball camera
*/
public void setArcBallCamera(final boolean c) {
isUsingArcBallCamera = c;
notifyListeners(Changes.CHANGE_CAMERA, c);
}
/**
* @return
*/
public boolean isLayerSplitted() { return isSplittingLayers; }
/**
* Sets the layer splitted.
*
* @param s
* the new layer splitted
*/
public void setLayerSplitted(final boolean s) {
isSplittingLayers = s;
if (s) {
notifyListeners(Changes.SPLIT_LAYER, splitDistance);
} else {
notifyListeners(Changes.SPLIT_LAYER, 0d);
}
}
/**
* Gets the split distance.
*
* @return the split distance
*/
public Double getSplitDistance() {
if (splitDistance == null) { splitDistance = 0.05; }
return splitDistance;
}
/**
* Sets the split distance.
*
* @param s
* the new split distance
*/
public void setSplitDistance(final Double s) {
splitDistance = s;
if (isSplittingLayers) { notifyListeners(Changes.SPLIT_LAYER, s); }
}
/**
* Checks if is synchronized.
*
* @return true, if is synchronized
*/
public boolean isSynchronized() { return isSynchronized; }
/**
* Sets the synchronized.
*
* @param isSynchronized
* the new synchronized
*/
public void setSynchronized(final boolean isSynchronized) { this.isSynchronized = isSynchronized; }
/**
* @return the zoomLevel
*/
public Double getZoomLevel() { return zoomLevel; }
/**
* @param zoomLevel
* the zoomLevel to set
*/
public void setZoomLevel(final Double zoomLevel, final boolean notify, final boolean force) {
if (this.zoomLevel != null && this.zoomLevel.equals(zoomLevel)) return;
this.zoomLevel = zoomLevel;
if (notify) { notifyListeners(Changes.ZOOM, this.zoomLevel); }
}
/**
* Full screen.
*
* @return the int
*/
public int fullScreen() {
return fullScreen;
}
/**
* Sets the overlay.
*
* @param fs
* the new overlay
*/
public void setFullScreen(final int fs) { fullScreen = fs; }
/**
* Sets the keystone.
*
* @param value
* the new keystone
*/
public void setKeystone(final List<GamaPoint> value) {
if (value == null) return;
this.keystone.setTo(value.toArray(new GamaPoint[4]));
notifyListeners(Changes.KEYSTONE, this.keystone);
}
/**
* Sets the keystone.
*
* @param value
* the new keystone
*/
public void setKeystone(final ICoordinates value) {
if (value == null) return;
this.keystone.setTo(value.toCoordinateArray());
notifyListeners(Changes.KEYSTONE, this.keystone);
}
/**
* Gets the keystone.
*
* @return the keystone
*/
public ICoordinates getKeystone() { return this.keystone; }
/**
* Checks if is keystone defined.
*
* @return true, if is keystone defined
*/
public boolean isKeystoneDefined() { return !keystone.equals(KEYSTONE_IDENTITY); }
/**
* Sets the preset camera.
*
* @param newValue