/** * Converts the numerical value of a configuration file orthogonal layout style to an enumeration * value. * * @param type The configuration file settings type that provides the numerical value. * @return The corresponding enumeration value or a default value if the value from the * configuration file is invalid. */ private static OrthogonalStyle getOrthogonalStyle(final GraphSettingsConfigItem type) { try { return OrthogonalStyle.parseInt(type.getOrthogonalLayoutStyle()); } catch (final IllegalStateException e) { CUtilityFunctions.logException(e); return OrthogonalStyle.NORMAL; } }
/** * Converts the numerical value of a configuration file orthogonal orientation to an enumeration * value. * * @param type The configuration file settings type that provides the numerical value. * @return The corresponding enumeration value or a default value if the value from the * configuration file is invalid. */ private static OrthogonalOrientation getOrthogonalOrientation( final GraphSettingsConfigItem type) { try { return OrthogonalOrientation.parseInt(type.getOrthogonalOrientation()); } catch (final IllegalStateException e) { CUtilityFunctions.logException(e); return OrthogonalOrientation.VERTICAL; } }
/** * Changes the current orthogonal layout style setting. * * @param value The new value of the orthogonal layout style setting. */ public void setStyle(final OrthogonalStyle value) { Preconditions.checkNotNull(value, "IE00887: Style argument must not be negative"); if (value == getStyle()) { return; } if (m_type == null) { m_style = value; } else { m_type.setOrthogonalLayoutStyle(value.ordinal()); } }
/** * Changes the current orthogonal orientation setting. * * @param value The new value of the orthogonal orientation setting. */ public void setOrientation(final OrthogonalOrientation value) { Preconditions.checkNotNull(value, "IE00888: Orientation argument must not be negative"); if (value == getOrientation()) { return; } if (m_type == null) { m_orientation = value; } else { m_type.setOrthogonalOrientation(value.ordinal()); } }
/** * Changes the current minimum orthogonal node distance setting. * * @param value The new value of the minimum orthogonal node distance setting. */ public void setMinimumNodeDistance(final int value) { Preconditions.checkArgument(value >= 0, "IE00885: Distance argument must not be negative"); if (value == getMinimumNodeDistance()) { return; } if (m_type == null) { m_mininmumNodeDistance = value; } else { m_type.setOrthogonalMinimumNodeDistance(value); } }
/** * Returns the current minimum orthogonal node distance. * * @return The current minimum orthogonal node distance. */ public int getMinimumNodeDistance() { return m_type == null ? m_mininmumNodeDistance : m_type.getOrthogonalMinimumNodeDistance(); }