Called when the label has changed in some meaningful way and we'd accordingly like to
re-layout the label, update our component's size, and repaint everything to suit.
551975
protected void layoutLabel ()
    {
        Graphics2D gfx = (Graphics2D)getGraphics();
        if (gfx != null) {
            // re-layout the label
            _label.layout(gfx);
            gfx.dispose();

            // note that we're no longer dirty
            _dirty = false;
        }
    }
299654
def remake_display(self, *args):
        
        Builder.load_string(self.kv)
        if hasattr(self, '_kv_layout'):
            self.remove_widget(self._kv_layout)
            del self._kv_layout
        self._kv_layout = KvLayout()
        self.add_widget(self._kv_layout)
409245
private void updateSize() {
        int newLineCount = ActionUtils.getLineCount(pane);
        if (newLineCount == lineCount) {
            return;
        }
        lineCount = newLineCount;
        int h = (int) pane.getPreferredSize().getHeight();
        int d = (int) Math.log10(lineCount) + 1;
        if (d < 1) {
            d = 1;
        }
        int w = d * charWidth + r_margin + l_margin;
        format = "%" + d + "d";
        setPreferredSize(new Dimension(w, h));
        getParent().doLayout();
    }
110152
function sizeChange() {
      if (options.fixedSize) {
        adaptFontSize();
      } else {
        if (isUtimage) {
          adaptImageHeight();
        } else {
          adaptPostHeight();
        }
      }

      if (options.chars && mode && mode.editor === true) {
        updateCharactersCounter();
      }
    }
252906
def refresh(self):
        
        _logger().log(5, 'refresh_panels')
        self.resize()
        self._update(self.editor.contentsRect(), 0,
                     force_update_margins=True)
411793
function(){
    this.width = this.container.width();
    this.height = this.container.height();
    this.resize();
    this.canvas.setSize(this.width, this.height);
    this.applyTransform();
  }
211784
def _update_labels(self, label, pad_box, height, width):
        """"""
        out = label.copy()
        out[:, (1, 3)] = (out[:, (1, 3)] * width + pad_box[0]) / pad_box[2]
        out[:, (2, 4)] = (out[:, (2, 4)] * height + pad_box[1]) / pad_box[3]
        return out
661327
def on_state_changed(self, state):
        
        if state:
            self.editor.painted.connect(self._paint_margins)
            self.editor.key_pressed.connect(self._on_key_pressed)
            self.editor.repaint()
        else:
            self.editor.painted.disconnect(self._paint_margins)
            self.editor.key_pressed.disconnect(self._on_key_pressed)
            self.editor.repaint()
1161784
private void updateTargetDescription() {
		if( targetPt != null ) {
			TupleDesc feature = describe.createDescription();
			describe.process(targetPt.x,targetPt.y,targetOrientation,targetRadius,feature);
			tuplePanel.setDescription(feature);
		} else {
			tuplePanel.setDescription(null);
		}
		tuplePanel.repaint();
	}
773707
def refresh(self):
        """"""
        logger.debug('Refresh panels')
        self.resize()
        self._update(self.editor.contentsRect(), 0,
                     force_update_margins=True)
1261715
function _updateOverwriteLabel(event, editor, newstate, doNotAnimate) {
        if ($statusOverwrite.text() === (newstate ? Strings.STATUSBAR_OVERWRITE : Strings.STATUSBAR_INSERT)) {
            // label already up-to-date
            return;
        }

        $statusOverwrite.text(newstate ? Strings.STATUSBAR_OVERWRITE : Strings.STATUSBAR_INSERT);

        if (!doNotAnimate) {
            AnimationUtils.animateUsingClass($statusOverwrite[0], "flash", 1500);
        }
    }
533700
def on_resize(self, *args):
        """"""
        # pylint: disable=W0613
        #         Unused argument 'args'
        self.screen.style.name_len = min(self.screen.style.name_len,
                                         self.term.width - 15)
        assert self.term.width >= self.screen.hint_width, (
            'Screen to small {}, must be at least {}'.format(
                self.term.width, self.screen.hint_width))
        self._set_lastpage()
        self.dirty = self.STATE_REFRESH
1008610
function(el, value) {
	        if (el.holderData) {
	            el.holderData.resizeUpdate = !!value;
	            if (el.holderData.resizeUpdate) {
	                updateResizableElements(el);
	            }
	        }
	    }
790657
def update_label(self):
        """"""
        current_file = str(self.selectedFiles()[0])
        if not '.' in current_file.split(os.path.sep)[-1]:
            # add hdf5 extention if none given
            current_file += '.hdf5'
        if os.path.isfile(current_file):
            self.setLabelText(QtGui.QFileDialog.Accept, 'Reload')
        elif os.path.isdir(current_file):
            self.setLabelText(QtGui.QFileDialog.Accept, 'Open')
        else:
            self.setLabelText(QtGui.QFileDialog.Accept, 'Create')
627119
def newShape(self):
        
        if not self.useDefaultLabelCheckbox.isChecked() or not self.defaultLabelTextLine.text():
            if len(self.labelHist) > 0:
                self.labelDialog = LabelDialog(
                    parent=self, listItem=self.labelHist)

            # Sync single class mode from PR#106
            if self.singleClassMode.isChecked() and self.lastLabel:
                text = self.lastLabel
            else:
                text = self.labelDialog.popUp(text=self.prevLabelText)
                self.lastLabel = text
        else:
            text = self.defaultLabelTextLine.text()

        # Add Chris
        self.diffcButton.setChecked(False)
        if text is not None:
            self.prevLabelText = text
            generate_color = generateColorByText(text)
            shape = self.canvas.setLastLabel(text, generate_color, generate_color)
            self.addLabel(shape)
            if self.beginner():  # Switch to edit mode.
                self.canvas.setEditing(True)
                self.actions.create.setEnabled(True)
            else:
                self.actions.editMode.setEnabled(True)
            self.setDirty()

            if text not in self.labelHist:
                self.labelHist.append(text)
        else:
            # self.canvas.undoLastLine()
            self.canvas.resetAllLines()
307295
def on_size(self, event):
        ''''''
        state = self.state
        size = event.GetSize()
        state.width = size.width
        state.height = size.height
        self.redraw_map()
358787
function updateLabels(potentialLabel) {
    var lowerCaseLabel = potentialLabel.toLowerCase();
    if (!labelSet.hasOwnProperty(lowerCaseLabel)) {
      labels.push(potentialLabel);
      // now value is in our set
      labelSet[lowerCaseLabel] = true;
    }
    return lowerCaseLabel;
  }