public float get (Actor context) { return actor.getHeight() * percent; } };
public float get (Actor actor) { return actor.getHeight() * percent; } };
public float get (Actor context) { return actor.getHeight() * percent; } };
public float get (Actor actor) { return actor.getHeight() * percent; } };
public float get (Actor context) { if (context instanceof Layout) return ((Layout)context).getPrefHeight(); return context == null ? 0 : context.getHeight(); } };
public float get (Actor context) { if (context instanceof Layout) return ((Layout)context).getMinHeight(); return context == null ? 0 : context.getHeight(); } };
public float get (Actor context) { if (context instanceof Layout) return ((Layout)context).getMaxHeight(); return context == null ? 0 : context.getHeight(); } };
public float get (Actor context) { if (context instanceof Layout) return ((Layout)context).getPrefHeight(); return context == null ? 0 : context.getHeight(); } };
public float get (Actor context) { if (context instanceof Layout) return ((Layout)context).getMinHeight(); return context == null ? 0 : context.getHeight(); } };
public float get (Actor context) { if (context instanceof Layout) return ((Layout)context).getMaxHeight(); return context == null ? 0 : context.getHeight(); } };
protected void begin () { startWidth = target.getWidth(); startHeight = target.getHeight(); }
protected void begin () { startWidth = target.getWidth(); startHeight = target.getHeight(); }
@Override public float getPrefHeight () { float first = firstWidget == null ? 0 : (firstWidget instanceof Layout ? ((Layout)firstWidget).getPrefHeight() : firstWidget.getHeight()); float second = secondWidget == null ? 0 : (secondWidget instanceof Layout ? ((Layout)secondWidget).getPrefHeight() : secondWidget.getHeight()); if (!vertical) return Math.max(first, second); return first + style.handle.getMinHeight() + second; }
@Override public float getPrefHeight () { float first = firstWidget == null ? 0 : (firstWidget instanceof Layout ? ((Layout)firstWidget).getPrefHeight() : firstWidget.getHeight()); float second = secondWidget == null ? 0 : (secondWidget instanceof Layout ? ((Layout)secondWidget).getPrefHeight() : secondWidget.getHeight()); if (!vertical) return Math.max(first, second); return first + style.handle.getMinHeight() + second; }
private void computeSize (Array<Node> nodes, float indent, float plusMinusWidth) { float ySpacing = this.ySpacing; float spacing = iconSpacingLeft + iconSpacingRight; for (int i = 0, n = nodes.size; i < n; i++) { Node node = nodes.get(i); float rowWidth = indent + plusMinusWidth; Actor actor = node.actor; if (actor instanceof Layout) { Layout layout = (Layout)actor; rowWidth += layout.getPrefWidth(); node.height = layout.getPrefHeight(); } else { rowWidth += actor.getWidth(); node.height = actor.getHeight(); } if (node.icon != null) { rowWidth += spacing + node.icon.getMinWidth(); node.height = Math.max(node.height, node.icon.getMinHeight()); } prefWidth = Math.max(prefWidth, rowWidth); prefHeight -= node.height + ySpacing; if (node.expanded) computeSize(node.children, indent + indentSpacing, plusMinusWidth); } }
private void computeSize (Array<Node> nodes, float indent, float plusMinusWidth) { float ySpacing = this.ySpacing; float spacing = iconSpacingLeft + iconSpacingRight; for (int i = 0, n = nodes.size; i < n; i++) { Node node = nodes.get(i); float rowWidth = indent + plusMinusWidth; Actor actor = node.actor; if (actor instanceof Layout) { Layout layout = (Layout)actor; rowWidth += layout.getPrefWidth(); node.height = layout.getPrefHeight(); } else { rowWidth += actor.getWidth(); node.height = actor.getHeight(); } if (node.icon != null) { rowWidth += spacing + node.icon.getMinWidth(); node.height = Math.max(node.height, node.icon.getMinHeight()); } prefWidth = Math.max(prefWidth, rowWidth); prefHeight -= node.height + ySpacing; if (node.expanded) computeSize(node.children, indent + indentSpacing, plusMinusWidth); } }
private void setContainerPosition (Actor actor, float x, float y) { this.targetActor = actor; Stage stage = actor.getStage(); if (stage == null) return; container.pack(); float offsetX = manager.offsetX, offsetY = manager.offsetY, dist = manager.edgeDistance; Vector2 point = actor.localToStageCoordinates(tmp.set(x + offsetX, y - offsetY - container.getHeight())); if (point.y < dist) point = actor.localToStageCoordinates(tmp.set(x + offsetX, y + offsetY)); if (point.x < dist) point.x = dist; if (point.x + container.getWidth() > stage.getWidth() - dist) point.x = stage.getWidth() - dist - container.getWidth(); if (point.y + container.getHeight() > stage.getHeight() - dist) point.y = stage.getHeight() - dist - container.getHeight(); container.setPosition(point.x, point.y); point = actor.localToStageCoordinates(tmp.set(actor.getWidth() / 2, actor.getHeight() / 2)); point.sub(container.getX(), container.getY()); container.setOrigin(point.x, point.y); }
private void setContainerPosition (Actor actor, float x, float y) { this.targetActor = actor; Stage stage = actor.getStage(); if (stage == null) return; container.pack(); float offsetX = manager.offsetX, offsetY = manager.offsetY, dist = manager.edgeDistance; Vector2 point = actor.localToStageCoordinates(tmp.set(x + offsetX, y - offsetY - container.getHeight())); if (point.y < dist) point = actor.localToStageCoordinates(tmp.set(x + offsetX, y + offsetY)); if (point.x < dist) point.x = dist; if (point.x + container.getWidth() > stage.getWidth() - dist) point.x = stage.getWidth() - dist - container.getWidth(); if (point.y + container.getHeight() > stage.getHeight() - dist) point.y = stage.getHeight() - dist - container.getHeight(); container.setPosition(point.x, point.y); point = actor.localToStageCoordinates(tmp.set(actor.getWidth() / 2, actor.getHeight() / 2)); point.sub(container.getX(), container.getY()); container.setOrigin(point.x, point.y); }