Divider overrideSublayer(Divider override, Direction sourceDirection, Direction targetDirection) { Divider overridden = new Divider(this); if (override.hasSublayer(sourceDirection)) { Sublayer overrideSublayer = override.getSublayer(sourceDirection); if (!overridden.hasSublayer(targetDirection) || overrideSublayer.isCloserThan(overridden.getSublayer(targetDirection))) { overridden.sublayers.put(targetDirection, overrideSublayer); } } return overridden; }
Divider override(Divider override, EnumSet<Direction> overrideDirections, int depth) { Divider overridden = new Divider(this); for (Direction direction : overrideDirections) { Sublayer sublayer = override.getSublayer(direction); if (sublayer != null && (!overridden.hasSublayer(direction) || depth >= getSublayer(direction).getDepth())) { overridden.sublayers.put(direction, new Sublayer(sublayer.getDrawable(), depth)); } } return overridden; }