1 package nl.tudelft.simulation.dsol.web.animation.D2; 2 3 import nl.tudelft.simulation.dsol.animation.Locatable; 4 5 /** 6 * ToggleButtonInfo.java. <br> 7 * <br> 8 * Copyright (c) 2003-2018 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See 9 * for project information <a href="https://www.simulation.tudelft.nl/" target="_blank">www.simulation.tudelft.nl</a>. The 10 * source code and binary code of this software is proprietary information of Delft University of Technology. 11 * @author <a href="https://www.tudelft.nl/averbraeck" target="_blank">Alexander Verbraeck</a> 12 */ 13 public class ToggleButtonInfo 14 { 15 /** the name of the button. */ 16 private final String name; 17 18 /** whether the class is shown or not. */ 19 private boolean visible; 20 21 /** 22 * @param name String; the name of the button 23 * @param visible boolean; whether the class is initially shown or not 24 */ 25 protected ToggleButtonInfo(String name, boolean visible) 26 { 27 super(); 28 this.name = name; 29 this.visible = visible; 30 } 31 32 /** 33 * @return visible 34 */ 35 public final boolean isVisible() 36 { 37 return this.visible; 38 } 39 40 /** 41 * @param visible set visible 42 */ 43 public final void setVisible(boolean visible) 44 { 45 this.visible = visible; 46 } 47 48 /** 49 * @return name 50 */ 51 public final String getName() 52 { 53 return this.name; 54 } 55 56 /** 57 * ToggleButtonInfo.LocatableClass. <br> 58 * <br> 59 * Copyright (c) 2003-2018 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. 60 * See for project information <a href="https://www.simulation.tudelft.nl/" target="_blank">www.simulation.tudelft.nl</a>. 61 * The source code and binary code of this software is proprietary information of Delft University of Technology. 62 * @author <a href="https://www.tudelft.nl/averbraeck" target="_blank">Alexander Verbraeck</a> 63 */ 64 public static class LocatableClass extends ToggleButtonInfo 65 { 66 /** the class for which the button holds (e.g., GTU.class). */ 67 private final Class<? extends Locatable> locatableClass; 68 69 /** the tool tip text to show when hovering over the button. */ 70 private final String toolTipText; 71 72 /** 73 * @param name String; the name of the button 74 * @param locatableClass Class<? extends Locatable>; the class for which the button holds (e.g., GTU.class) 75 * @param toolTipText String; the tool tip text to show when hovering over the button 76 * @param visible boolean; whether the class is initially shown or not 77 */ 78 public LocatableClass(String name, Class<? extends Locatable> locatableClass, String toolTipText, boolean visible) 79 { 80 super(name, visible); 81 this.locatableClass = locatableClass; 82 this.toolTipText = toolTipText; 83 } 84 85 /** 86 * @return locatableClass 87 */ 88 public final Class<? extends Locatable> getLocatableClass() 89 { 90 return this.locatableClass; 91 } 92 93 /** 94 * @return toolTipText 95 */ 96 public final String getToolTipText() 97 { 98 return this.toolTipText; 99 } 100 } 101 102 /** 103 * ToggleButtonInfo.Text. <br> 104 * <br> 105 * Copyright (c) 2003-2018 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. 106 * See for project information <a href="https://www.simulation.tudelft.nl/" target="_blank">www.simulation.tudelft.nl</a>. 107 * The source code and binary code of this software is proprietary information of Delft University of Technology. 108 * @author <a href="https://www.tudelft.nl/averbraeck" target="_blank">Alexander Verbraeck</a> 109 */ 110 public static class Text extends ToggleButtonInfo 111 { 112 /** 113 * @param name String; the name of the button 114 * @param visible boolean; whether the class is initially shown or not 115 */ 116 public Text(String name, boolean visible) 117 { 118 super(name, visible); 119 } 120 } 121 122 /** 123 * ToggleButtonInfo.Gis. <br> 124 * <br> 125 * Copyright (c) 2003-2018 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. 126 * See for project information <a href="https://www.simulation.tudelft.nl/" target="_blank">www.simulation.tudelft.nl</a>. 127 * The source code and binary code of this software is proprietary information of Delft University of Technology. 128 * @author <a href="https://www.tudelft.nl/averbraeck" target="_blank">Alexander Verbraeck</a> 129 */ 130 public static class Gis extends ToggleButtonInfo 131 { 132 /** the GIS layer name. */ 133 private final String layerName; 134 135 /** the tool tip text to show when hovering over the button. */ 136 private final String toolTipText; 137 138 /** 139 * @param name String; the name of the button 140 * @param layerName String; the GIS layer name 141 * @param toolTipText String; the tool tip text to show when hovering over the button 142 * @param visible boolean; whether the class is initially shown or not 143 */ 144 public Gis(String name, String layerName, String toolTipText, boolean visible) 145 { 146 super(name, visible); 147 this.layerName = layerName; 148 this.toolTipText = toolTipText; 149 } 150 151 /** 152 * @return layerName 153 */ 154 public final String getLayerName() 155 { 156 return this.layerName; 157 } 158 159 /** 160 * @return toolTipText 161 */ 162 public final String getToolTipText() 163 { 164 return this.toolTipText; 165 } 166 } 167 168 }