MCPcopy Create free account
hub / github.com/Nurtak/ObjectGraphVisualization / calcMinWidth

Method calcMinWidth

src/ch/hsr/ogv/view/PaneBox.java:324–334  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

322 }
323
324 public double calcMinWidth() {
325 // + 70px / 40px for some additional space to compensate padding, insets, borders etc.
326 double retWidth = TextUtil.computeTextWidth(getTopFont(), getTopTextField().getText(), 0.0D) + 70;
327 for (TextField centerTextField : getCenterTextFields()) {
328 double newWidth = TextUtil.computeTextWidth(centerTextField.getFont(), centerTextField.getText(), 0.0D) + 40;
329 if (newWidth > retWidth) {
330 retWidth = newWidth;
331 }
332 }
333 return restrictedWidth(retWidth);
334 }
335
336 public double calcMinHeight() {
337 double newMinHeight = minHeightPer(getCenterLabels().size());

Callers 6

createArrayBoxMethod · 0.95
adaptBoxTopFieldMethod · 0.95
adaptCenterFieldsMethod · 0.95
changedMethod · 0.45
setArrowLabelsMethod · 0.45
setArrowLabelsMethod · 0.45

Calls 6

computeTextWidthMethod · 0.95
getTopFontMethod · 0.95
getTopTextFieldMethod · 0.95
getCenterTextFieldsMethod · 0.95
restrictedWidthMethod · 0.95
getFontMethod · 0.80

Tested by

no test coverage detected