Dart Documentationdock_spawn

dock_spawn library

Methods

Code debug_DumpTree(DockNode node, [int indent = 0]) #

Prints out the dock layout hierarchy structure WARNING: Assumes that the graph is acyclic

debug_DumpTree(DockNode node, [int indent = 0]) {
  String message = node.container.name;
  
  for (int i = 0; i < indent; i++) {
     message = "\t$message";
  }
  String parentType = node.parent == null ? "null" : node.parent.container.containerType;
  print (">>$message [$parentType]");
  
  node.children.forEach((childNode) => debug_DumpTree(childNode, indent + 1));
}

Code void disableGlobalTextSelection() #

void disableGlobalTextSelection() {
  window.document.body.classes.add("disable-selection");
}

Code void enableGlobalTextSelection() #

void enableGlobalTextSelection() {
  window.document.body.classes.remove("disable-selection");
}

Code Point2 getMousePosition(MouseEvent e, Element element) #

Point2 getMousePosition(MouseEvent e, Element element) {
  int parentOffsetX = element.$dom_offsetLeft;
  int parentOffsetY = element.$dom_offsetTop;
  int parentWidth = element.$dom_clientWidth;
  int parentHeight = element.$dom_clientHeight;
  int x = e.x - parentOffsetX;
  int y = e.y - parentOffsetY;
  return new Point2(x, y);
}

Code String getNextId(String prefix) #

String getNextId(String prefix) {
  return "${prefix}${dockIdCounter++}";
}

Code int getPixels(String pixels) #

int getPixels(String pixels) {
  if (pixels == null) return 0;
  return Math.parseInt(pixels.replaceAll("px", ""));
}

Code bool isPointInsideNode(int px, int py, DockNode node) #

bool isPointInsideNode(int px, int py, DockNode node) {
  Element element = node.container.containerElement;
  int x = element.$dom_offsetLeft;
  int y = element.$dom_offsetTop;
  int width = element.$dom_clientWidth;
  int height = element.$dom_clientHeight;
  
  return (px >= x && px <= x + width && py >= y && py <= y + height);
}

Fields

Code int dockIdCounter #

int dockIdCounter = 0;

Classes

Interfaces

Exceptions