public class RendererModel extends Object implements Serializable, Cloneable
IRenderer
that contains settings for drawing objects.Modifier and Type | Class and Description |
---|---|
static class |
RendererModel.ColorHash
The color hash is used to color substructures.
|
static class |
RendererModel.ExternalHighlightColor
The color used to highlight external selections.
|
static class |
RendererModel.MarkedOutput
If format supports it (e.g.
|
static class |
RendererModel.Padding
Padding between molecules in a grid or row.
|
static class |
RendererModel.SelectionColor
Color of a selection.
|
static class |
RendererModel.TitleColor
Color of title text.
|
static class |
RendererModel.TitleFontScale
Size of title font relative compared to atom symbols
|
Constructor and Description |
---|
RendererModel()
Construct a renderer model with no parameters.
|
Modifier and Type | Method and Description |
---|---|
void |
addCDKChangeListener(ICDKChangeListener listener)
Adds a change listener to the list of listeners.
|
void |
fireChange()
Notifies registered listeners of certain changes that have occurred in
this model.
|
<T extends IGeneratorParameter<S>,S> |
get(Class<T> paramType)
Returns the
IGeneratorParameter for the active IRenderer . |
IAtomContainer |
getClipboardContent()
Returns the atoms and bonds on the Renderer2D clipboard.
|
<T extends IGeneratorParameter<S>,S> |
getDefault(Class<T> param)
Returns the default value for the
IGeneratorParameter for the
active IRenderer . |
IAtomContainer |
getExternalSelectedPart()
Get externally selected atoms.
|
IAtom |
getHighlightedAtom()
Returns the atom currently highlighted.
|
IBond |
getHighlightedBond()
Returns the Bond currently highlighted.
|
Map<IAtom,IAtom> |
getMerge()
This is the central facility for handling "merges" of atoms.
|
boolean |
getNotification()
Determines if the model sends around change notifications.
|
<T extends IGeneratorParameter<?>> |
getParameter(Class<T> param)
Returns the
IGeneratorParameter for the active IRenderer . |
List<IGeneratorParameter<?>> |
getRenderingParameters()
Returns all
IGeneratorParameter s for the current
RendererModel . |
IChemObjectSelection |
getSelection()
Returns an
IChemObjectSelection with the currently selected
IChemObject s. |
String |
getToolTipText(IAtom atom)
Gets the toolTipText for atom certain atom.
|
Map<IAtom,String> |
getToolTipTextMap()
Gets the toolTipTextMap.
|
<T extends IGeneratorParameter<?>> |
hasParameter(Class<T> param)
Returns true if the passed
IGeneratorParameter s has been
registered. |
void |
registerParameters(IGenerator<? extends IChemObject> generator)
Registers rendering parameters from
IGenerator s
with this model. |
void |
removeCDKChangeListener(ICDKChangeListener listener)
Removes a change listener from the list of listeners.
|
<T extends IGeneratorParameter<S>,S,U extends S> |
set(Class<T> paramType,
U value)
Sets the
IGeneratorParameter for the active IRenderer . |
void |
setClipboardContent(IAtomContainer content)
Sets the atoms and bonds on the Renderer2D clipboard.
|
void |
setExternalSelectedPart(IAtomContainer externalSelectedPart)
Set externally selected atoms.
|
void |
setHighlightedAtom(IAtom highlightedAtom)
Sets the atom currently highlighted.
|
void |
setHighlightedBond(IBond highlightedBond)
Sets the Bond currently highlighted.
|
void |
setNotification(boolean notification)
Dis- or enables sending around change notifications.
|
void |
setSelection(IChemObjectSelection selection)
Set the selected
IChemObject s. |
void |
setToolTipTextMap(Map<IAtom,String> map)
Sets the toolTipTextMap.
|
public RendererModel()
public List<IGeneratorParameter<?>> getRenderingParameters()
IGeneratorParameter
s for the current
RendererModel
.IGeneratorParameter
spublic <T extends IGeneratorParameter<?>> T getParameter(Class<T> param)
IGeneratorParameter
for the active IRenderer
.
It returns a new instance of it was unregistered.param
- IGeneratorParameter
to get the value of.IGeneratorParameter
instance with the active value.public <T extends IGeneratorParameter<S>,S> S getDefault(Class<T> param)
IGeneratorParameter
for the
active IRenderer
.param
- IGeneratorParameter
to get the value of.IGeneratorParameter
-typed param
parameter.get(Class)
public <T extends IGeneratorParameter<S>,S,U extends S> void set(Class<T> paramType, U value)
IGeneratorParameter
for the active IRenderer
.T
- paramType
- IGeneratorParameter
to set the value of.value
- new IGeneratorParameter
valuepublic <T extends IGeneratorParameter<S>,S> S get(Class<T> paramType)
IGeneratorParameter
for the active IRenderer
.T
- paramType
- IGeneratorParameter
to get the value of.IGeneratorParameter
value.getParameter(Class)
public void registerParameters(IGenerator<? extends IChemObject> generator)
IGenerator
s
with this model.generator
- public void setSelection(IChemObjectSelection selection)
IChemObject
s.selection
- an IChemObjectSelection
with selected
IChemObject
spublic IChemObjectSelection getSelection()
IChemObjectSelection
with the currently selected
IChemObject
s.IChemObject
spublic Map<IAtom,IAtom> getMerge()
public IAtom getHighlightedAtom()
public void setHighlightedAtom(IAtom highlightedAtom)
highlightedAtom
- The atom to be highlightedpublic IBond getHighlightedBond()
public void setHighlightedBond(IBond highlightedBond)
highlightedBond
- The Bond to be currently highlightedpublic IAtomContainer getClipboardContent()
public void setClipboardContent(IAtomContainer content)
content
- the new content of the clipboard.public void addCDKChangeListener(ICDKChangeListener listener)
listener
- The listener added to the listpublic void removeCDKChangeListener(ICDKChangeListener listener)
listener
- The listener removed from the listpublic void fireChange()
public String getToolTipText(IAtom atom)
atom
- The atom.public void setToolTipTextMap(Map<IAtom,String> map)
map
- A map containing Atoms of the current molecule as keys and
Strings to display as values. A line break will be inserted
where a \n is in the string.public Map<IAtom,String> getToolTipTextMap()
public IAtomContainer getExternalSelectedPart()
public void setExternalSelectedPart(IAtomContainer externalSelectedPart)
externalSelectedPart
- the selected partpublic boolean getNotification()
public <T extends IGeneratorParameter<?>> boolean hasParameter(Class<T> param)
IGeneratorParameter
s has been
registered.param
- parameter for which it is tested if it is registeredpublic void setNotification(boolean notification)
notification
- true if notifications should be sent, false otherwise.Copyright © 2021. All rights reserved.