Class mxMultiplicity
java.lang.Object
com.mxgraph.view.mxMultiplicity
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringOptional string that specifies the attributename to be passed to mxCell.is to check if the rule applies to a cell.protected StringHolds the localized error message to be displayed if the number of connections for which the rule applies is smaller than min or greater than max.protected StringDefines the maximum number of connections for which this rule applies.protected intDefines the minimum number of connections for which this rule applies.protected booleanBoolean that specifies if the rule is applied to the source or target terminal of an edge.protected StringDefines the type of the source or target terminal.protected StringHolds the localized error message to be displayed if the type of the neighbor for a connection does not match the rule.protected Collection<String> Holds an array of strings that specify the type of neighbor for which this rule applies.protected booleanBoolean indicating if the list of validNeighbors are those that are allowed for this rule or those that are not allowed for this rule.protected StringOptional string that specifies the value of the attribute to be passed to mxCell.is to check if the rule applies to a cell. -
Constructor Summary
ConstructorsConstructorDescriptionmxMultiplicity(boolean source, String type, String attr, String value, int min, String max, Collection<String> validNeighbors, String countError, String typeError, boolean validNeighborsAllowed) -
Method Summary
Modifier and TypeMethodDescriptionFunction: check Checks the multiplicity for the given arguments and returns the error for the given connection or null if the multiplicity does not apply.booleancheckNeighbors(mxGraph graph, Object edge, Object source, Object target) Checks the type of the given value.booleancheckTerminal(mxGraph graph, Object terminal, Object edge) Checks the type of the given value.booleanChecks the type of the given value.booleanChecks the type of the given value.intReturns the numeric value of max.booleanReturns true if max is "n" (unlimited).
-
Field Details
-
type
Defines the type of the source or target terminal. The type is a string passed to mxUtils.isNode together with the source or target vertex value as the first argument. -
attr
Optional string that specifies the attributename to be passed to mxCell.is to check if the rule applies to a cell. -
value
Optional string that specifies the value of the attribute to be passed to mxCell.is to check if the rule applies to a cell. -
source
protected boolean sourceBoolean that specifies if the rule is applied to the source or target terminal of an edge. -
min
protected int minDefines the minimum number of connections for which this rule applies. Default is 0. -
max
Defines the maximum number of connections for which this rule applies. A value of 'n' means unlimited times. Default is 'n'. -
validNeighbors
Holds an array of strings that specify the type of neighbor for which this rule applies. The strings are used in mxCell.is on the opposite terminal to check if the rule applies to the connection. -
validNeighborsAllowed
protected boolean validNeighborsAllowedBoolean indicating if the list of validNeighbors are those that are allowed for this rule or those that are not allowed for this rule. -
countError
Holds the localized error message to be displayed if the number of connections for which the rule applies is smaller than min or greater than max. -
typeError
Holds the localized error message to be displayed if the type of the neighbor for a connection does not match the rule.
-
-
Constructor Details
-
mxMultiplicity
-
-
Method Details
-
check
public String check(mxGraph graph, Object edge, Object source, Object target, int sourceOut, int targetIn) Function: check Checks the multiplicity for the given arguments and returns the error for the given connection or null if the multiplicity does not apply. Parameters: graph - Reference to the enclosing graph instance. edge - Cell that represents the edge to validate. source - Cell that represents the source terminal. target - Cell that represents the target terminal. sourceOut - Number of outgoing edges from the source terminal. targetIn - Number of incoming edges for the target terminal. -
checkNeighbors
-
checkTerminal
-
checkType
-
checkType
-
isUnlimited
public boolean isUnlimited()Returns true if max is "n" (unlimited). -
getMaxValue
public int getMaxValue()Returns the numeric value of max.
-