Generates the standard Javascript event handlers.
@param rw The response writer
@param component the current component
@throws IOException thrown if something goes wrong when writing the HTML code
431026
public static void generateJSEventHandlers(ResponseWriter rw, UIComponent component) throws IOException {
		Map<String, Object> attributes = component.getAttributes();
		String[] eventHandlers = {"onclick", "onblur", "onmouseover"};
        for (String event:eventHandlers) {
        	String handler = A.asString(attributes.get(event));
        	if (null != handler) {
        		rw.writeAttribute(event, handler, event);
        	}
        }
	}
780123
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WPasswordField field = (WPasswordField) component;
		XmlStringBuilder xml = renderContext.getWriter();

		boolean readOnly = field.isReadOnly();

		xml.appendTagOpen(TAG_NAME);
		xml.appendAttribute("id", component.getId());
		xml.appendOptionalAttribute("class", component.getHtmlClass());
		xml.appendOptionalAttribute("track", component.isTracking(), "true");
		xml.appendOptionalAttribute("hidden", component.isHidden(), "true");

		if (readOnly) {
			xml.appendAttribute("readOnly", "true");
			xml.appendEnd();
			return;
		}
		int cols = field.getColumns();
		int minLength = field.getMinLength();
		int maxLength = field.getMaxLength();
		WComponent submitControl = field.getDefaultSubmitButton();
		String submitControlId = submitControl == null ? null : submitControl.getId();

		xml.appendOptionalAttribute("disabled", field.isDisabled(), "true");
		xml.appendOptionalAttribute("required", field.isMandatory(), "true");
		xml.appendOptionalAttribute("minLength", minLength > 0, minLength);
		xml.appendOptionalAttribute("maxLength", maxLength > 0, maxLength);
		xml.appendOptionalAttribute("toolTip", field.getToolTip());
		xml.appendOptionalAttribute("accessibleText", field.getAccessibleText());
		xml.appendOptionalAttribute("size", cols > 0, cols);
		xml.appendOptionalAttribute("buttonId", submitControlId);
		String placeholder = field.getPlaceholder();
		xml.appendOptionalAttribute("placeholder", !Util.empty(placeholder), placeholder);
		String autocomplete = field.getAutocomplete();
		xml.appendOptionalAttribute("autocomplete", !Util.empty(autocomplete), autocomplete);

		List<Diagnostic> diags = field.getDiagnostics(Diagnostic.ERROR);
		if (diags == null || diags.isEmpty()) {
			xml.appendEnd();
			return;
		}
		xml.appendClose();
		DiagnosticRenderUtil.renderDiagnostics(field, renderContext);
		xml.appendEndTag(TAG_NAME);
	}
1011820
protected void writeFrameworkScript(AbstractRenderAppender sb)
    {
        boolean script = false;
        ScriptRequestState jsu = ScriptRequestState.getScriptRequestState((HttpServletRequest) pageContext.getRequest());

        boolean writeLegacy = false;
        boolean writeName = false;
        String val;

        // if we are writing out legacy JavaScript support output the idMap
        if (TagConfig.isLegacyJavaScript()) {
            val = processIdMap(_idMap, "idMappingEntry", _idScope);
            if (val != null) {
                writeIdMap(this, "idMappingTable", val);
                writeLegacy = true;
            }
        }

        // if we are writing out default JavaScript support we create the name map
        if (TagConfig.isDefaultJavaScript()) {
            String idScope = getJavaScriptId();
            if (idScope.equals(""))
                idScope = null;
            val = processIdMap(_idToNameMap, "tagIdNameMappingEntry", idScope);
            if (val != null) {
                writeIdMap(this, "tagIdNameMappingTable", val);
                writeName = true;
            }
        }

        if (writeLegacy || _writeId || writeName)
            jsu.writeNetuiNameFunctions(this, writeLegacy, _writeId, writeName);

        ScriptTag.State state = null;
        ScriptTag br = null;
        if (_funcBlocks != null && _funcBlocks.size() > 0) {
            if (!script) {
                state = new ScriptTag.State();
                state.suppressComments = false;
                br = (ScriptTag) TagRenderingBase.Factory.getRendering(TagRenderingBase.SCRIPT_TAG, pageContext.getRequest());
                br.doStartTag(sb, state);
                script = true;
            }
            String s = ScriptRequestState.getString("functionComment", null);
            sb.append(s);
            int cnt = _funcBlocks.size();
            for (int i = 0; i < cnt; i++) {
                sb.append((String)_funcBlocks.get(i));
                if (i != cnt - 1) {
                    sb.append("\n");
                }
            }
        }

        if (script) {
            assert(br != null);
            br.doEndTag(sb, false);
        }
    }
50336
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WSingleSelect listBox = (WSingleSelect) component;
		XmlStringBuilder xml = renderContext.getWriter();
		String dataKey = listBox.getListCacheKey();
		boolean readOnly = listBox.isReadOnly();
		int rows = listBox.getRows();

		xml.appendTagOpen("ui:listbox");
		xml.appendAttribute("id", component.getId());
		xml.appendOptionalAttribute("class", component.getHtmlClass());
		xml.appendOptionalAttribute("track", component.isTracking(), "true");
		xml.appendOptionalAttribute("hidden", listBox.isHidden(), "true");
		if (readOnly) {
			xml.appendAttribute("readOnly", "true");
		} else {
			xml.appendOptionalAttribute("data", dataKey != null, dataKey);
			xml.appendOptionalAttribute("disabled", listBox.isDisabled(), "true");
			xml.appendOptionalAttribute("required", listBox.isMandatory(), "true");
			xml.appendOptionalAttribute("submitOnChange", listBox.isSubmitOnChange(), "true");
			xml.appendOptionalAttribute("toolTip", component.getToolTip());
			xml.appendOptionalAttribute("accessibleText", component.getAccessibleText());
			xml.appendOptionalAttribute("rows", rows >= 2, rows);
			String autocomplete = listBox.getAutocomplete();
			xml.appendOptionalAttribute("autocomplete", !Util.empty(autocomplete), autocomplete);
		}
		xml.appendAttribute("single", "true");

		xml.appendClose();

		// Options
		List<?> options = listBox.getOptions();
		boolean renderSelectionsOnly = readOnly || dataKey != null;

		if (options != null) {
			int optionIndex = 0;
			Object selectedOption = listBox.getSelected();

			for (Object option : options) {
				if (option instanceof OptionGroup) {
					xml.appendTagOpen("ui:optgroup");
					xml.appendAttribute("label", ((OptionGroup) option).getDesc());
					xml.appendClose();

					for (Object nestedOption : ((OptionGroup) option).getOptions()) {
						renderOption(listBox, nestedOption, optionIndex++, xml, selectedOption, renderSelectionsOnly);
					}

					xml.appendEndTag("ui:optgroup");
				} else {
					renderOption(listBox, option, optionIndex++, xml, selectedOption, renderSelectionsOnly);
				}
			}
		}

		if (!readOnly) {
			DiagnosticRenderUtil.renderDiagnostics(listBox, renderContext);
		}
		xml.appendEndTag("ui:listbox");
	}
383761
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WShuffler shuffler = (WShuffler) component;
		XmlStringBuilder xml = renderContext.getWriter();
		boolean readOnly = shuffler.isReadOnly();

		// Start tag
		xml.appendTagOpen("ui:shuffler");
		xml.appendAttribute("id", component.getId());
		xml.appendOptionalAttribute("class", component.getHtmlClass());
		xml.appendOptionalAttribute("track", component.isTracking(), "true");
		xml.appendOptionalAttribute("hidden", shuffler.isHidden(), "true");
		if (readOnly) {
			xml.appendAttribute("readOnly", "true");
		} else {
			xml.appendOptionalAttribute("disabled", shuffler.isDisabled(), "true");
			xml.appendOptionalAttribute("toolTip", shuffler.getToolTip());
			xml.appendOptionalAttribute("accessibleText", shuffler.getAccessibleText());
			int rows = shuffler.getRows();
			xml.appendOptionalAttribute("rows", rows > 0, rows);
		}
		xml.appendClose();

		// Options
		List<?> options = shuffler.getOptions();

		if (options != null && !options.isEmpty()) {
			for (int i = 0; i < options.size(); i++) {
				String stringOption = String.valueOf(options.get(i));
				xml.appendTagOpen("ui:option");
				xml.appendAttribute("value", stringOption);
				xml.appendClose();
				xml.appendEscaped(stringOption);
				xml.appendEndTag("ui:option");
			}
		}

		if (!readOnly) {
			DiagnosticRenderUtil.renderDiagnostics(shuffler, renderContext);
		}
		// End tag
		xml.appendEndTag("ui:shuffler");
	}
639771
public void service(HttpServletRequest request, HttpServletResponse response) throws IOException {

        // Get the script path from the request - include aware (GROOVY-815)
        final String scriptUri = getScriptUri(request);

        // Set it to HTML by default
        response.setContentType("text/html; charset="+encoding);

        // Set up the script context
        final ServletBinding binding = new ServletBinding(request, response, servletContext);
        setVariables(binding);

        // Run the script
        try {
            Closure closure = new Closure(gse) {

                public Object call() {
                    try {
                        return ((GroovyScriptEngine) getDelegate()).run(scriptUri, binding);
                    } catch (ResourceException | ScriptException e) {
                        throw new RuntimeException(e);
                    }
                }

            };
            GroovyCategorySupport.use(ServletCategory.class, closure);
        } catch (RuntimeException runtimeException) {
            StringBuilder error = new StringBuilder("GroovyServlet Error: ");
            error.append(" script: '");
            error.append(scriptUri);
            error.append("': ");
            Throwable e = runtimeException.getCause();
            /*
             * Null cause?!
             */
            if (e == null) {
                error.append(" Script processing failed.\n");
                error.append(runtimeException.getMessage());
                if (runtimeException.getStackTrace().length > 0)
                    error.append(runtimeException.getStackTrace()[0].toString());
                servletContext.log(error.toString());
                System.err.println(error.toString());
                runtimeException.printStackTrace(System.err);
                response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, error.toString());
                return;
            }
            /*
             * Resource not found.
             */
            if (e instanceof ResourceException) {
                error.append(" Script not found, sending 404.");
                servletContext.log(error.toString());
                System.err.println(error.toString());
                response.sendError(HttpServletResponse.SC_NOT_FOUND);
                return;
            }
            /*
             * Other internal error. Perhaps syntax?!
             */
            servletContext.log("An error occurred processing the request", runtimeException);
            error.append(e.getMessage());
            if (e.getStackTrace().length > 0)
                error.append(e.getStackTrace()[0].toString());
            servletContext.log(e.toString());
            System.err.println(e.toString());
            runtimeException.printStackTrace(System.err);
            response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.toString());
        }
    }
19008
public void actionPerformed(ActionEvent evt)
    {
        Component component = (Component)evt.getSource();
        String strMessage = component.getName();
        if (strMessage == null)
        {
            strMessage = evt.getActionCommand();
            Action action = ActionManager.getActionManager().getActionFromCommand(strMessage);
            if (action instanceof BaseAction)
                strMessage = ((BaseAction)action).getActionKey();
        }
        if ((strMessage != null) && (strMessage.length() > 0))
            BaseApplet.handleAction(strMessage, this, this, 0);
    }
1283699
@Override
    protected void processComponent(final Object component) {
        injectFields(component);
        if (component instanceof Initiated) {
            try {
                ((Initiated) component).initiate();
            } catch (final Exception exception) {
                throw new RuntimeException("Unable to initiate component: " + component, exception);
            }
        }
        if (component instanceof Destructible) {
            destructibles.add((Destructible) component);
        }
    }
276149
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WMenuItem item = (WMenuItem) component;
		XmlStringBuilder xml = renderContext.getWriter();

		xml.appendTagOpen("ui:menuitem");
		xml.appendAttribute("id", component.getId());
		xml.appendOptionalAttribute("class", component.getHtmlClass());
		xml.appendOptionalAttribute("track", component.isTracking(), "true");

		if (item.isSubmit()) {
			xml.appendAttribute("submit", "true");
		} else {
			xml.appendOptionalUrlAttribute("url", item.getUrl());
			xml.appendOptionalAttribute("targetWindow", item.getTargetWindow());
		}

		xml.appendOptionalAttribute("disabled", item.isDisabled(), "true");
		xml.appendOptionalAttribute("hidden", item.isHidden(), "true");
		xml.appendOptionalAttribute("selected", item.isSelected(), "true");
		xml.appendOptionalAttribute("role", getRole(item));
		xml.appendOptionalAttribute("cancel", item.isCancel(), "true");
		xml.appendOptionalAttribute("msg", item.getMessage());
		xml.appendOptionalAttribute("toolTip", item.getToolTip());

		if (item.isTopLevelItem()) {
			xml.appendOptionalAttribute("accessKey", item.getAccessKeyAsString());
		}

		xml.appendClose();

		item.getDecoratedLabel().paint(renderContext);

		xml.appendEndTag("ui:menuitem");
	}
109880
private static void generateToCConnectionListener(Map<String, List<TraceEvent>> events, FileWriter fw)
      throws Exception
   {
      writeString(fw, "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"");
      writeEOL(fw);
      writeString(fw, "                      \"http://www.w3.org/TR/html4/loose.dtd\">");
      writeEOL(fw);

      writeString(fw, "<html>");
      writeEOL(fw);

      writeString(fw, "<head>");
      writeEOL(fw);

      writeString(fw, "<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\">");
      writeEOL(fw);

      writeString(fw, "<title>Reference: ConnectionListener</title>");
      writeEOL(fw);

      writeString(fw, "</head>");
      writeEOL(fw);

      writeString(fw, "<body style=\"background: #D7D7D7;\">");
      writeEOL(fw);

      writeString(fw, "<h1>Reference: ConnectionListener</h1>");
      writeEOL(fw);

      writeString(fw, "<table>");
      writeEOL(fw);
      
      writeString(fw, "<tr>");
      writeEOL(fw);

      writeString(fw, "<td><b>ConnectionListener</b></td>");
      writeEOL(fw);

      writeString(fw, "<td><b>ManagedConnectionPool</b></td>");
      writeEOL(fw);

      writeString(fw, "<td><b>Pool</b></td>");
      writeEOL(fw);

      writeString(fw, "</tr>");
      writeEOL(fw);

      for (Map.Entry<String, List<TraceEvent>> entry : events.entrySet())
      {
         TraceEvent te = entry.getValue().get(0);

         writeString(fw, "<tr>");
         writeEOL(fw);

         writeString(fw, "<td><a href=\"" + te.getPool() + "/" + te.getConnectionListener() + "/index.html\">" +
                     te.getConnectionListener() + "</a></td>");
         writeEOL(fw);
         
         writeString(fw, "<td>" + te.getManagedConnectionPool() + "</td>");
         writeEOL(fw);
      
         writeString(fw, "<td><a href=\"" + te.getPool() + "/index.html\">" + te.getPool() + "</a></td>");
         writeEOL(fw);
      
         writeString(fw, "</tr>");
         writeEOL(fw);
      }

      writeString(fw, "</table>");
      writeEOL(fw);

      writeString(fw, "<p>");
      writeEOL(fw);

      writeString(fw, "<a href=\"index.html\">Back</a>");
      writeEOL(fw);

      writeString(fw, "</body>");
      writeEOL(fw);

      writeString(fw, "</html>");
      writeEOL(fw);
   }
350048
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WImageEditor editorComponent = (WImageEditor) component;
		XmlStringBuilder xml = renderContext.getWriter();

		xml.appendTagOpen("wc-imageedit");
		xml.appendAttribute("id", editorComponent.getId());
		xml.appendOptionalAttribute("class", editorComponent.getHtmlClass());
		xml.appendOptionalUrlAttribute("overlay", editorComponent.getOverlayUrl());
		xml.appendOptionalAttribute("camera", editorComponent.getUseCamera());
		xml.appendOptionalAttribute("face", editorComponent.getIsFace());
		xml.appendOptionalAttribute("inline", editorComponent.getRenderInline());

		// Check for size information on the image
		Dimension size = editorComponent.getSize();
		if (size != null) {
			if (size.getHeight() >= 0) {
				xml.appendAttribute("height", size.height);
			}

			if (size.getWidth() >= 0) {
				xml.appendAttribute("width", size.width);
			}
		}

		xml.appendEnd();
	}
244548
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WSuggestions suggestions = (WSuggestions) component;
		XmlStringBuilder xml = renderContext.getWriter();

		// Cache key for a lookup table
		String dataKey = suggestions.getListCacheKey();
		// Use AJAX if not using a cached list and have a refresh action
		boolean useAjax = dataKey == null && suggestions.getRefreshAction() != null;

		// Start tag
		xml.appendTagOpen("ui:suggestions");
		xml.appendAttribute("id", component.getId());
		xml.appendOptionalAttribute("class", component.getHtmlClass());
		xml.appendOptionalAttribute("track", component.isTracking(), "true");
		xml.appendOptionalAttribute("min", suggestions.getMinRefresh() > 0, suggestions.
				getMinRefresh());
		xml.appendOptionalAttribute("ajax", useAjax, "true");
		xml.appendOptionalAttribute("data", dataKey);
		WSuggestions.Autocomplete autocomplete = suggestions.getAutocomplete();
		if (autocomplete == WSuggestions.Autocomplete.LIST) {
			xml.appendOptionalAttribute("autocomplete", "list");
		}
		xml.appendClose();

		// Check if this is the current AJAX trigger
		boolean isTrigger = useAjax && AjaxHelper.isCurrentAjaxTrigger(suggestions);

		// Render suggestions
		if (isTrigger || (dataKey == null && !useAjax)) {
			for (String suggestion : suggestions.getSuggestions()) {
				xml.appendTagOpen("ui:suggestion");
				xml.appendAttribute("value", suggestion);
				xml.appendEnd();
			}
		}

		// End tag
		xml.appendEndTag("ui:suggestions");
	}
82326
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		XmlStringBuilder xml = renderContext.getWriter();
		WButton button = (WButton) component;
		String text = button.getText();
		String imageUrl = button.getImageUrl();
		String accessibleText = button.getAccessibleText();
		String toolTip = button.getToolTip();

		if (Util.empty(text) && imageUrl == null && Util.empty(accessibleText) && Util.empty(toolTip)) {
			throw new SystemException("WButton text or imageUrl must be specified");
		}

		xml.appendTagOpen(getTagName(button));

		String buttonId = button.getId();
		ImagePosition pos = button.getImagePosition();
		if (Util.empty(text) && Util.empty(toolTip) && Util.empty(accessibleText)) {
			// If the button has an imageUrl but no text equivalent get the text equivalent off of the image
			WImage imgHolder = button.getImageHolder();
			if (null != imgHolder) {
				toolTip = imgHolder.getAlternativeText();
			}
		}

		xml.appendAttribute("id", buttonId);
		xml.appendAttribute("name", buttonId);
		xml.appendAttribute("value", "x");
		xml.appendAttribute("type", getButtonType(button));
		xml.appendAttribute("class", geHtmlClassName(button));
		xml.appendOptionalAttribute("disabled", button.isDisabled(), "disabled");
		xml.appendOptionalAttribute("hidden", button.isHidden(), "hidden");
		xml.appendOptionalAttribute("title", toolTip);
		xml.appendOptionalAttribute("aria-label", accessibleText);
		xml.appendOptionalAttribute("aria-haspopup", button.isPopupTrigger(), "true");
		xml.appendOptionalAttribute("accesskey", Util.upperCase(button.getAccessKeyAsString()));
		xml.appendOptionalAttribute("data-wc-btnmsg", button.getMessage());

		if (button.isCancel()) {
			xml.appendAttribute("formnovalidate", "formnovalidate");
		} else {
			Action action = button.getAction();
			if (action instanceof ValidatingAction) {
				WComponent validationTarget = ((ValidatingAction) action).getComponentToValidate();
				xml.appendAttribute("data-wc-validate", validationTarget.getId());
			}
		}

		xml.appendClose();

		if (imageUrl != null) {
			xml.appendTagOpen("span");
			String imageHolderClass =  "wc_nti";
			if (pos != null) {
				StringBuffer imageHolderClassBuffer = new StringBuffer("wc_btn_img wc_btn_img");
				switch (pos) {
					case NORTH:
						imageHolderClassBuffer.append("n");
						break;
					case EAST:
						imageHolderClassBuffer.append("e");
						break;
					case SOUTH:
						imageHolderClassBuffer.append("s");
						break;
					case WEST:
						imageHolderClassBuffer.append("w");
						break;
					default:
						throw new SystemException("Unknown image position: " + pos);
				}
				imageHolderClass = imageHolderClassBuffer.toString();
			}
			xml.appendAttribute("class", imageHolderClass);
			xml.appendClose();

			if (pos != null && text != null) {
				xml.appendTag("span");
				xml.appendEscaped(text);
				xml.appendEndTag("span");
			}

			xml.appendTagOpen("img");
			xml.appendUrlAttribute("src", imageUrl);
			String alternateText = pos == null ? text : "";
			xml.appendAttribute("alt", alternateText);
			xml.appendEnd();
			xml.appendEndTag("span");
		} else if (text != null) {
			xml.appendEscaped(text);
		}

		xml.appendEndTag(getTagName(button));

		if (button.isAjax()) {
			paintAjax(button, xml);
		}
	}
23222
function fireWindowResizeEvent(event) {
        frameIsRequested = false;
        if (!componentInformation) {
            return;
        }
        var handlerResults = [];
        componentInformation.forEach(function (componentInformation, i) {
            // Skip if the component is not running anymore
            if (componentInformation.component._stopped) {
                return;
            }
            componentInformation.selectors.forEach(function (selector) {
                return selector.forEach(function (handler) {
                    return handlerResults.push(handler.call(componentInformation.component, event));
                });
            });
        });
        handlerResults.forEach(function (handlerResult) {
            if (typeof handlerResult === "function") {
                handlerResult();
            }
        });
    }
657972
@Override protected void handleEvents(final String EVENT_TYPE) {
        if ("REDRAW".equals(EVENT_TYPE)) {
            pane.setEffect(gauge.isShadowsEnabled() ? mainInnerShadow1 : null);
            shadowGroup.setEffect(gauge.isShadowsEnabled() ? FOREGROUND_SHADOW : null);
            updateLcdDesign(height);
            redraw();
        } else if ("RESIZE".equals(EVENT_TYPE)) {
            aspectRatio = gauge.getPrefHeight() / gauge.getPrefWidth();
            resize();
            redraw();
        } else if ("LCD".equals(EVENT_TYPE)) {
            updateLcdDesign(height);
        } else if ("VISIBILITY".equals(EVENT_TYPE)) {
            Helper.enableNode(crystalOverlay, gauge.isLcdCrystalEnabled());
            Helper.enableNode(title, !gauge.getTitle().isEmpty());
            Helper.enableNode(unitText, !gauge.getUnit().isEmpty());
            Helper.enableNode(upperLeftText, gauge.isMinMeasuredValueVisible());
            Helper.enableNode(upperRightText, gauge.isMaxMeasuredValueVisible());
            Helper.enableNode(lowerRightText, !gauge.getSubTitle().isEmpty());
            Helper.enableNode(lowerCenterText, gauge.isOldValueVisible());
            Helper.enableNode(average, gauge.isAverageVisible());
            Helper.enableNode(threshold, gauge.isThresholdVisible());
            resize();
            redraw();
        } else if ("SECTION".equals(EVENT_TYPE)) {
            sections = gauge.getSections();
            updateSectionColors();
            resize();
            redraw();
        }
    }
123246
protected void renderSpacerCell(FacesContext facesContext, ResponseWriter writer, UIComponent component)
        throws IOException 
    {
        UIComponent spacer = getNewspaperTableSpacer(component);
        if(spacer == null)
        {
            return;
        }
         
         writer.startElement(HTML.TD_ELEM, null); // component);
         //RendererUtils.renderChild(facesContext, spacer);
         spacer.encodeAll(facesContext);
         writer.endElement(HTML.TD_ELEM);
     }
1276861
@Override protected void handleEvents(final String EVENT_TYPE) {
        if ("RESIZE".equals(EVENT_TYPE)) {
            resize();
            redraw();
        } else if ("REDRAW".equals(EVENT_TYPE)) {
            redraw();
        } else if ("RECALC".equals(EVENT_TYPE)) {
            minValue  = gauge.getMinValue();
            range     = gauge.getRange();
            angleStep = ANGLE_RANGE / range;
            redraw();
            setBar(gauge.getCurrentValue());
        } else if ("VISIBILITY".equals(EVENT_TYPE)) {
            Helper.enableNode(valueText, gauge.isValueVisible());
            Helper.enableNode(unitText, !gauge.getUnit().isEmpty());
        }
    }