Class DefaultFilterControl<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
- java.lang.Object
-
- net.sf.gridarta.gui.filter.DefaultFilterControl<G,A,R>
-
- All Implemented Interfaces:
FilterControl<G,A,R>
public class DefaultFilterControl<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> extends java.lang.Object implements FilterControl<G,A,R>
Control for filters.Control to check if 1) a specific GameObject can be shown (filter out of view part) 2) a specific MapSquare must be highlighted (analysis part) It provides only one filterOut path (and so elements are visible or not, they can't be twice visible or such). It provides 3 highlight paths. each of them can be (dis)enabled. So you can, e.g., highlight walls in a specific color, teleporters in another and monsters in a third. highlight and filterOut filters works all the same. You can activate specific predefined filters or you can provide your own. If several predefined Filters are activated for a path, they are combined in an OR way. For example, if you enable the filterOut path, activate in this path the wall and the floor filters, only walls and floors will be shown.
-
-
Field Summary
-
Fields inherited from interface net.sf.gridarta.gui.filter.FilterControl
MAX_HIGHLIGHT
-
-
Constructor Summary
Constructors Constructor Description DefaultFilterControl(@NotNull NamedFilter filterList, @NotNull EditorSettings editorSettings)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddConfigListener(@NotNull FilterConfigListener listener)Adds aFilterConfigListenerto be notified about changes.voidaddFilter(@NotNull java.lang.String name, @NotNull Filter<?,?> filter)booleancanShow(G gameObject)voidcreateMenuEntries(@NotNull javax.swing.JMenu menu)booleanisHighlightedSquare(@NotNull FilterState filterState, int path)voidnewSquare(@NotNull FilterState filterState)voidobjectInSquare(@NotNull FilterState filterState, G gameObject)voidremoveConfigListener(@NotNull FilterConfigListener listener)Removes aFilterConfigListenerto be notified about changes.voidremoveFilter(@NotNull java.lang.String name)
-
-
-
Constructor Detail
-
DefaultFilterControl
public DefaultFilterControl(@NotNull @NotNull NamedFilter filterList, @NotNull @NotNull EditorSettings editorSettings)Creates a new instance. Does not highlight anything and does not filter out anything- Parameters:
filterList- the filter list instance to useeditorSettings- the global editor seetings instance
-
-
Method Detail
-
addConfigListener
public void addConfigListener(@NotNull @NotNull FilterConfigListener listener)Description copied from interface:FilterControlAdds aFilterConfigListenerto be notified about changes.- Specified by:
addConfigListenerin interfaceFilterControl<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>- Parameters:
listener- the config listener
-
removeConfigListener
public void removeConfigListener(@NotNull @NotNull FilterConfigListener listener)Description copied from interface:FilterControlRemoves aFilterConfigListenerto be notified about changes.- Specified by:
removeConfigListenerin interfaceFilterControl<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>- Parameters:
listener- the config listener
-
createMenuEntries
public void createMenuEntries(@NotNull @NotNull javax.swing.JMenu menu)- Specified by:
createMenuEntriesin interfaceFilterControl<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
-
newSquare
public void newSquare(@NotNull @NotNull FilterState filterState)- Specified by:
newSquarein interfaceFilterControl<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
-
isHighlightedSquare
public boolean isHighlightedSquare(@NotNull @NotNull FilterState filterState, int path)- Specified by:
isHighlightedSquarein interfaceFilterControl<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
-
objectInSquare
public void objectInSquare(@NotNull @NotNull FilterState filterState, @NotNull G gameObject)- Specified by:
objectInSquarein interfaceFilterControl<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
-
canShow
public boolean canShow(@NotNull G gameObject)- Specified by:
canShowin interfaceFilterControl<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
-
addFilter
public void addFilter(@NotNull @NotNull java.lang.String name, @NotNull @NotNull Filter<?,?> filter)- Specified by:
addFilterin interfaceFilterControl<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
-
removeFilter
public void removeFilter(@NotNull @NotNull java.lang.String name)- Specified by:
removeFilterin interfaceFilterControl<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
-
-