*
Performs coloring of the textpane. This method needs to be rewriten.

@throws Exception
3489
public void recolorQuery() throws Exception {
		PrefixManager man = apic.getMutablePrefixManager();

		String input = doc.getText(0, doc.getLength());
		ImmutableList<TargetAtom> current_query = parse(input, man);

		if (current_query == null) {
            JOptionPane.showMessageDialog(null, "An error occured while parsing the mappings. For more info, see the logs.");
			throw new Exception("Unable to parse the query: " + input + ", " + parsingException);
		}
		input = doc.getText(0, doc.getLength());

		resetStyles();

		int pos = input.indexOf("(", 0);
		while (pos != -1) {
			doc.setCharacterAttributes(pos, 1, brackets, false);
			pos = input.indexOf("(", pos + 1);
		}
		pos = input.indexOf(")", 0);
		while (pos != -1) {
			doc.setCharacterAttributes(pos, 1, brackets, false);
			pos = input.indexOf(")", pos + 1);
		}
		pos = input.indexOf(".", 0);
		while (pos != -1) {
			doc.setCharacterAttributes(pos, 1, black, false);
			pos = input.indexOf(".", pos + 1);
		}
		pos = input.indexOf(",", 0);
		while (pos != -1) {
			doc.setCharacterAttributes(pos, 1, black, false);
			pos = input.indexOf(",", pos + 1);
		}
		pos = input.indexOf(":", 0);
		while (pos != -1) {
			doc.setCharacterAttributes(pos, 1, black, false);
			pos = input.indexOf(":", pos + 1);
		}
		MutableOntologyVocabulary vocabulary = apic.getCurrentVocabulary();
		for (TargetAtom atom : current_query) {
			Optional<IRI> optionalPredicateIri = atom.getPredicateIRI();

			if (optionalPredicateIri.isPresent()) {
				IRI predicateIri = optionalPredicateIri.get();
				String shortIRIForm = man.getShortForm(predicateIri.getIRIString());

				if (vocabulary.classes().contains(predicateIri)) {
					ColorTask task = new ColorTask(shortIRIForm, clazz);
					tasks.add(task);
				} else if (vocabulary.objectProperties().contains(predicateIri)) {
					ColorTask task = new ColorTask(shortIRIForm, objectProp);
					tasks.add(task);
				} else if (vocabulary.dataProperties().contains(predicateIri)) {
					ColorTask task = new ColorTask(shortIRIForm, dataProp);
					tasks.add(task);
				} else if (vocabulary.annotationProperties().contains(predicateIri)) {
					ColorTask task = new ColorTask(shortIRIForm, annotProp);
					tasks.add(task);
				}
			}

			ImmutableList<ImmutableTerm> substitutedTerms = atom.getSubstitutedTerms();
			RDFAtomPredicate atomPredicate = (RDFAtomPredicate) atom.getProjectionAtom().getPredicate();

			ImmutableTerm term1 = atomPredicate.getSubject(substitutedTerms);
			ImmutableTerm term2 = atomPredicate.getObject(substitutedTerms);

			if (term1 instanceof IRIConstant) {
				String rendered = man.getShortForm(((IRIConstant) term1).getIRI().toString());
				ColorTask task = new ColorTask(rendered, individual);
				tasks.add(task);
			}
			if (term2 instanceof IRIConstant) {
				String rendered = man.getShortForm(((IRIConstant) term2).getIRI().toString());
				ColorTask task = new ColorTask(rendered, individual);
				tasks.add(task);
			}
		}

		ColorTask[] taskArray = order(tasks);
		for (int i = 0; i < taskArray.length; i++) {
			if (taskArray[i].text != null) {
				int index = input.indexOf(taskArray[i].text, 0);
				while (index != -1) {
					doc.setCharacterAttributes(index, taskArray[i].text.length(), taskArray[i].set, true);
					index = input.indexOf(taskArray[i].text, index + 1);
				}
			}
		}
		tasks.clear();
	}
952917
private void processSetColorOps(String methodName) throws ClassNotFoundException {
        if ("setBackground".equals(methodName) || "setForeground".equals(methodName)) {
            int argCount = SignatureUtils.getNumParameters(getSigConstantOperand());
            if (stack.getStackDepth() > argCount) {
                OpcodeStack.Item item = stack.getStackItem(0);
                if (S508UserValue.FROM_UIMANAGER != item.getUserValue()) {
                    item = stack.getStackItem(argCount);
                    JavaClass cls = item.getJavaClass();
                    if (((jcomponentClass != null) && cls.instanceOf(jcomponentClass)) || ((componentClass != null) && cls.instanceOf(componentClass))) {
                        bugReporter.reportBug(
                                new BugInstance(this, BugType.S508C_SET_COMP_COLOR.name(), NORMAL_PRIORITY).addClass(this).addMethod(this).addSourceLine(this));
                    }
                }
            }
        }
    }
1191728
protected void doStop() throws Exception
    {
        MultiException mex=new MultiException();
        
        
        Thread thread= Thread.currentThread();
        ClassLoader lastContextLoader= thread.getContextClassLoader();
        
        try
        {
            // Context listeners
            if (_contextListeners != null)
            {
                if (_webAppHandler != null)
                {
                    ServletContextEvent event= new ServletContextEvent(getServletContext());
                    
                    for (int i= LazyList.size(_contextListeners); i-- > 0;)
                    {
                        try 
                        {
                            ((ServletContextListener)LazyList.get(_contextListeners, i)).contextDestroyed(event);
                        }
                        catch (Exception e)
                        {
                            mex.add(e);
                        }
                    }
                }
            }
            _contextListeners= null;
            
            // Stop the context
            try
            {
                super.doStop();
            }
            catch (Exception e)
            {
                mex.add(e);
            }
            
            // clean up
            clearSecurityConstraints();
            
            if (_webAppHandler != null)
                removeHandler(_webAppHandler);
            _webAppHandler= null;
            
            if (_errorPages != null)
                _errorPages.clear();
            _errorPages= null;
            
            _webApp=null;
            _webInf=null;
            
            _configurations=null;
            
        }
        finally
        {
            thread.setContextClassLoader(lastContextLoader);
        }
        
        if (mex!=null)
            mex.ifExceptionThrow();
    }
174824
public void setAverageColor(final Color COLOR) {
        if (null == averageColor) {
            _averageColor = COLOR;
            fireUpdateEvent(REDRAW_EVENT);
        } else {
            averageColor.set(COLOR);
        }
    }
62983
public function run()
    {
        $this->run_called = true;
        $this->hook('beforeRender');
        $this->is_rendering = true;

        // if no App layout set
        if (!isset($this->html)) {
            throw new Exception(['App layout should be set.']);
        }

        $this->html->template->set('title', $this->title);
        $this->html->renderAll();
        $this->html->template->appendHTML('HEAD', $this->html->getJS());
        $this->is_rendering = false;
        $this->hook('beforeOutput');

        if (isset($_GET['__atk_callback']) && $this->catch_runaway_callbacks) {
            $this->terminate('!! Callback requested, but never reached. You may be missing some arguments in '.$_SERVER['REQUEST_URI']);
        }

        echo $this->html->template->render();
    }
102286
private void colorChooserRootTextActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_colorChooserRootTextActionPerformed
    if (this.colorChooserRootText.isLastOkPressed() && changeNotificationAllowed) {
      this.controller.changed();
    }
  }
750585
public final void addHelperTextColor(@ColorInt final int color) {
        if (!helperTextColors.contains(color)) {
            helperTextColors.add(color);
            verifyPasswordStrength();
        }
    }
1094099
public void applyToOr(TextView textView, ColorStateList colorDefault) {
        if (mColorInt != 0) {
            textView.setTextColor(mColorInt);
        } else if (mColorRes != -1) {
            textView.setTextColor(ContextCompat.getColor(textView.getContext(), mColorRes));
        } else if (colorDefault != null) {
            textView.setTextColor(colorDefault);
        }
    }
1109009
public void setTextColor2(String color) throws HelloSignException {
        if (white_labeling_options == null) {
            white_labeling_options = new WhiteLabelingOptions();
        }
        white_labeling_options.setTextColor2(color);
    }
92760
@Override
    public void doRender(Invocation inv) throws Exception {
        if (StringUtils.isEmpty(text)) {
            return;
        }
        
        if (logger.isDebugEnabled()) {
        	logger.debug("trying to render text:" + text);
        }
        
        HttpServletResponse response = inv.getResponse();
        String oldEncoding = response.getCharacterEncoding();
        if (StringUtils.isBlank(oldEncoding) || oldEncoding.startsWith("ISO-")) {
            String encoding = inv.getRequest().getCharacterEncoding();
            Assert.isTrue(encoding != null);
            response.setCharacterEncoding(encoding);
            if (logger.isDebugEnabled()) {
                logger.debug("set response.characterEncoding by default:"
                        + response.getCharacterEncoding());
            }
        }
        
        if (response.getContentType() == null) {
            response.setContentType("text/html");
            if (logger.isDebugEnabled()) {
                logger.debug("set response content-type by default: "
                        + response.getContentType());
            }
        }
        sendResponse(response, text);
    }
698887
@Execute
    public void process() throws Exception {
        if (!concatOr(outFlow == null, doReset)) {
            return;
        }
        checkNull(inFlow, inPit);

        RegionMap regionMap = CoverageUtilities.getRegionParamsFromGridCoverage(inPit);
        cols = regionMap.getCols();
        rows = regionMap.getRows();
        xRes = regionMap.getXres();
        yRes = regionMap.getYres();
        dxySqrt = Math.sqrt(xRes * xRes + yRes * yRes);

        RenderedImage pitfillerRI = inPit.getRenderedImage();
        WritableRaster pitfillerWR = CoverageUtilities.renderedImage2DoubleWritableRaster(pitfillerRI, true);
        RenderedImage flowRI = inFlow.getRenderedImage();
        WritableRaster flowWR = CoverageUtilities.renderedImage2ShortWritableRaster(flowRI, true);

        RandomIter pitRandomIter = RandomIterFactory.create(pitfillerWR, null);

        // create new matrix
        double[] orderedelev = new double[cols * rows];
        int[] indexes = new int[cols * rows];

        int nelev = 0;
        for( int r = 0; r < rows; r++ ) {
            if (pm.isCanceled()) {
                return;
            }
            for( int c = 0; c < cols; c++ ) {
                double pitValue = pitRandomIter.getSampleDouble(c, r, 0);
                int pos = (r * cols) + c;
                orderedelev[pos] = pitValue;
                indexes[pos] = pos + 1;
                if (!isNovalue(pitValue)) {
                    nelev = nelev + 1;
                }
            }
        }

        QuickSortAlgorithm t = new QuickSortAlgorithm(pm);
        t.sort(orderedelev, indexes);

        pm.message(msg.message("draindir.initializematrix"));

        // Initialize new RasterData and set value
        WritableRaster tcaWR = CoverageUtilities.createWritableRaster(cols, rows, Integer.class, null, HMConstants.intNovalue);
        WritableRaster dirWR = CoverageUtilities.createWritableRaster(cols, rows, Short.class, null, HMConstants.shortNovalue);

        // it contains the analyzed cells
        WritableRaster deviationsWR = CoverageUtilities.createWritableRaster(cols, rows, Double.class, null, null);
        BitMatrix analizedMatrix = new BitMatrix(cols, rows);

        if (doLad) {
            orlandiniD8LAD(indexes, deviationsWR, analizedMatrix, pitfillerWR, flowWR, tcaWR, dirWR, nelev);
        } else {
            orlandiniD8LTD(indexes, deviationsWR, analizedMatrix, pitfillerWR, flowWR, tcaWR, dirWR, nelev);
            if (pm.isCanceled()) {
                return;
            }
            // only if required executes this method
            if (inFlownet != null) {
                newDirections(pitfillerWR, dirWR);
            }
        }
        if (pm.isCanceled()) {
            return;
        }
        outFlow = CoverageUtilities.buildCoverage("draindir", dirWR, regionMap, inPit.getCoordinateReferenceSystem());
        outTca = CoverageUtilities.buildCoverage("tca", tcaWR, regionMap, inPit.getCoordinateReferenceSystem());
    }
602273
public void displayDialog() throws Exception {

        initAdminTool();

        JspWriter out = getJsp().getJspContext().getOut();
        out.print(htmlStart());
        out.print(bodyStart(null));
        out.print("<form name='editor' method='post' target='_top' action='");
        out.print(getJsp().link("/system/workplace/editors/editor.jsp"));
        out.print("'>\n");
        out.print(paramsAsHidden());
        out.print("</form>\n");
        out.print("<script type='text/javascript'>\n");
        out.print("document.forms['editor'].submit();\n");
        out.print("</script>\n");
        out.print(bodyEnd());
        out.print(htmlEnd());
    }
1148858
public final void setErrorColor(@ColorInt final int color) {
        this.errorColor = color;

        if ((Boolean) leftMessage.getTag()) {
            leftMessage.setTextColor(color);
        }

        if ((Boolean) rightMessage.getTag()) {
            rightMessage.setTextColor(color);
        }
    }
723239
public void setColor(Color color)
	{
		if (null == color)
		{
			String _message = "The color must be non null.";
			Object[] _parameters = {};
			throw new IllegalArgumentException(MessageFormat.format(_message, _parameters));
		}
		myColor = color;
	}
1214728
private void colorChooserSelectLineActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_colorChooserSelectLineActionPerformed
    if (this.colorChooserSelectLine.isLastOkPressed() && changeNotificationAllowed) {
      this.controller.changed();
    }
  }
111729
public void printString(Color color, final PrintWriter writer) {
        color._switch(new ColorSwitchBlock() {            
            @Override
            public void _case(Red x) {
                writer.print("red");
            }
            
            @Override
            public void _case(Green x) {
                writer.print("green");                
            }
            
            @Override
            public void _case(Blue x) {
                writer.print("blue");
            }           
        });
    }
260100
private void buildFilmListFlash() throws Exception {
        final NodeList subtitleData = doc.getElementsByTagName("p");

        for (int i = 0; i < subtitleData.getLength(); i++) {
            final Subtitle subtitle = new Subtitle();

            final Node subnode = subtitleData.item(i);
            if (subnode.hasAttributes()) {
                // retrieve the begin and end attributes...
                final NamedNodeMap attrMap = subnode.getAttributes();
                final Node beginNode = attrMap.getNamedItem("begin");
                final Node endNode = attrMap.getNamedItem("end");
                if (beginNode != null && endNode != null) {
                    subtitle.begin = parseFlash(beginNode.getNodeValue());
                    subtitle.end = parseFlash(endNode.getNodeValue());
                    final StyledString textContent = new StyledString();
                    textContent.setColor(color); // sicher ist sicher
                    textContent.setText(subnode.getTextContent());

                    final Node col = attrMap.getNamedItem("tts:color");
                    if (col != null) {
                        textContent.setColor(col.getNodeValue());
                    } else {
                        final NodeList childNodes = subnode.getChildNodes();
                        for (int j = 0; j < childNodes.getLength(); j++) {
                            final Node node = childNodes.item(j);
                            if (node.getNodeName().equalsIgnoreCase("span")) {
                                //retrieve the text and color information...
                                final NamedNodeMap attr = node.getAttributes();
                                final Node co = attr.getNamedItem("tts:color");
                                textContent.setColor(co.getNodeValue());
                            }
                        }
                    }
                    subtitle.listOfStrings.add(textContent);

                }
            }
            subtitleList.add(subtitle);
        }
    }