當前位置: 首頁>>代碼示例>>Java>>正文


Java NoninvertibleTransformException類代碼示例

本文整理匯總了Java中java.awt.geom.NoninvertibleTransformException的典型用法代碼示例。如果您正苦於以下問題:Java NoninvertibleTransformException類的具體用法?Java NoninvertibleTransformException怎麽用?Java NoninvertibleTransformException使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


NoninvertibleTransformException類屬於java.awt.geom包,在下文中一共展示了NoninvertibleTransformException類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createImageProjected

import java.awt.geom.NoninvertibleTransformException; //導入依賴的package包/類
/**
 * Modify the GeometricLayer so the layer coordinate system matches the image coordinate system ("pixel" projection).
 */
public static GeometryImage createImageProjected(GeometryImage layer, AffineTransform geoTransform) {
    for(Geometry geom:layer.geoms){
        for(Coordinate pos:geom.getCoordinates()){
            Point2D.Double temp=new Point2D.Double();
            try {
	geoTransform.inverseTransform(new Point2D.Double(pos.x, pos.y),temp);
} catch (NoninvertibleTransformException e) {
	e.printStackTrace();
}
            pos.x=temp.x;
            pos.y=temp.y;
        }
    }
    return layer;
}
 
開發者ID:ec-europa,項目名稱:sumo,代碼行數:19,代碼來源:GeometryImage.java

示例2: pixellate

import java.awt.geom.NoninvertibleTransformException; //導入依賴的package包/類
/**
 * !!! not used currently, but might be by getPixelbounds?
 */
public void pixellate(FontRenderContext renderFRC, Point2D loc, Point pxResult) {
    if (renderFRC == null) {
        renderFRC = frc;
    }

    // it is a total pain that you have to copy the transform.

    AffineTransform at = renderFRC.getTransform();
    at.transform(loc, loc);
    pxResult.x = (int)loc.getX(); // but must not behave oddly around zero
    pxResult.y = (int)loc.getY();
    loc.setLocation(pxResult.x, pxResult.y);
    try {
        at.inverseTransform(loc, loc);
    }
    catch (NoninvertibleTransformException e) {
        throw new IllegalArgumentException("must be able to invert frc transform");
    }
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:23,代碼來源:StandardGlyphVector.java

示例3: resetDTX

import java.awt.geom.NoninvertibleTransformException; //導入依賴的package包/類
/**
 * Change the dtx for the strike refs we use.  Keeps a reference to the at.  At
 * must not contain translation.
 * Called by setRenderTransform, setDTX, initFontData.
 */
private final void resetDTX(AffineTransform at) {
    fsref = null;
    dtx = at;
    invdtx = null;
    if (!dtx.isIdentity()) {
        try {
            invdtx = dtx.createInverse();
        }
        catch (NoninvertibleTransformException e) {
            // we needn't care for rendering
        }
    }
    if (gti != null) {
        gti.strikesRef = null;
    }
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:22,代碼來源:StandardGlyphVector.java

示例4: extractRotation

import java.awt.geom.NoninvertibleTransformException; //導入依賴的package包/類
private static AffineTransform extractRotation(Point2D.Double pt,
    AffineTransform tx, boolean andTranslation) {

    tx.deltaTransform(pt, pt);
    AffineTransform rtx = AffineTransform.getRotateInstance(pt.x, pt.y);

    try {
        AffineTransform rtxi = rtx.createInverse();
        double dx = tx.getTranslateX();
        double dy = tx.getTranslateY();
        tx.preConcatenate(rtxi);
        if (andTranslation) {
            if (dx != 0 || dy != 0) {
                tx.setTransform(tx.getScaleX(), tx.getShearY(),
                                tx.getShearX(), tx.getScaleY(), 0, 0);
                rtx.setTransform(rtx.getScaleX(), rtx.getShearY(),
                                 rtx.getShearX(), rtx.getScaleY(), dx, dy);
            }
        }
    }
    catch (NoninvertibleTransformException e) {
        return null;
    }
    return rtx;
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:26,代碼來源:AttributeValues.java

示例5: computeAffineTransforms

import java.awt.geom.NoninvertibleTransformException; //導入依賴的package包/類
private void computeAffineTransforms() {
	if (natoceni == 0) {
		tam = null;
		zpet = null;
		return;
	}
	final AffineTransform tra = new AffineTransform();
	final double widthPul = (double) dim.width / 2;
	final double heightPul = (double) dim.height / 2;
	tra.translate(widthPul, heightPul);
	tra.rotate(natoceni);
	tra.translate(-widthPul, -heightPul);
	tam = tra;
	try {
		zpet = tam.createInverse();
	} catch (final NoninvertibleTransformException e) {
		throw new RuntimeException(e);
	}
}
 
開發者ID:marvertin,項目名稱:geokuk,代碼行數:20,代碼來源:Coord.java

示例6: updateLayout

import java.awt.geom.NoninvertibleTransformException; //導入依賴的package包/類
@Override
protected void updateLayout() {
    super.updateLayout();

    // Set the bounding node to match exactly the size of the viewport.
    AffineTransform transform = getWorldTransformStrategy().getTransform();
    AffineTransform inverseTransform;
    try {
        inverseTransform = transform.createInverse();
    }
    catch ( NoninvertibleTransformException e ) {
        System.err.println( getClass().getName() + " - Error: Unable to invert transform." );
        e.printStackTrace();
        inverseTransform = new AffineTransform(); // Unity transform by default.
    }
    Shape tranformedBounds = inverseTransform.createTransformedShape( getBounds() );

    _probeDragBounds.setPathTo( tranformedBounds );
}
 
開發者ID:mleoking,項目名稱:PhET,代碼行數:20,代碼來源:RadiometricMeasurementCanvas.java

示例7: setAmplitude

import java.awt.geom.NoninvertibleTransformException; //導入依賴的package包/類
private void setAmplitude( Point mousePoint ) {
    double localY = 0;
    try {
        AffineTransform transform = getNetTransform();
        transform.inverseTransform( mousePoint, _somePoint /* output */ );
        localY = _somePoint.getY();
    }
    catch ( NoninvertibleTransformException e ) {
        e.printStackTrace();
    }
    localY = -localY; // +Y is up
    double amplitude = MAX_AMPLITUDE * ( localY / ( _maxSize.height / 2.0 ) );
    amplitude = MathUtil.clamp( -MAX_AMPLITUDE, amplitude, +MAX_AMPLITUDE );
    _harmonic.setAmplitude( amplitude );

    fireChangeEvent();
}
 
開發者ID:mleoking,項目名稱:PhET,代碼行數:18,代碼來源:AmplitudeSlider.java

示例8: pick

import java.awt.geom.NoninvertibleTransformException; //導入依賴的package包/類
@Override
void pick(Point2D point, boolean boundingBox, List<List<SVGElement>> retVec) throws SVGException
{
    Point2D xPoint = new Point2D.Double(point.getX(), point.getY());
    if (xform != null)
    {
        try
        {
            xform.inverseTransform(point, xPoint);
        } catch (NoninvertibleTransformException ex)
        {
            throw new SVGException(ex);
        }
    }


    for (SVGElement ele : children) {
        if (ele instanceof RenderableElement)
        {
            RenderableElement rendEle = (RenderableElement) ele;

            rendEle.pick(xPoint, boundingBox, retVec);
        }
    }
}
 
開發者ID:Longri,項目名稱:cachebox3.0,代碼行數:26,代碼來源:Group.java

示例9: fill

import java.awt.geom.NoninvertibleTransformException; //導入依賴的package包/類
/**
 * @param geometry
 *            geometry to fill
 * @param viewport
 *            viewport
 * @param graphics
 *            graphics to draw into
 */
@SuppressWarnings("unchecked")
public static void fill(final IGeometry geometry, final Viewport viewport, final double opacity) {
    if (geometry.isPolygon()) {
        try {
            Shape shape = viewport.toShape(geometry);
            if (shape != null) {
                glFillNearlySimpleShape(shape);
            }
        } catch (NoninvertibleTransformException e) {
            e.printStackTrace();
        }
    } else {
        if (geometry.isMultiSurface()) {
            GM_Aggregate<IGeometry> aggregate = (GM_Aggregate<IGeometry>) geometry;
            for (IGeometry element : aggregate) {
                RenderGL11Util.fill(element, viewport, opacity);
            }
        }
    }
}
 
開發者ID:IGNF,項目名稱:geoxygene,代碼行數:29,代碼來源:RenderGL11Util.java

示例10: transform

import java.awt.geom.NoninvertibleTransformException; //導入依賴的package包/類
public void transform(AffineTransform tx)
{
  if (transform == null)
    transform = new AffineTransform(tx);
  else
    transform.concatenate(tx);

  if (clip != null)
    {
      try
        {
          AffineTransform clipTransform = tx.createInverse();
          updateClip(clipTransform);
        }
      catch (NoninvertibleTransformException ex)
        {
          // TODO: How can we deal properly with this?
          ex.printStackTrace();
        }
    }

  setTransformImpl(transform);
}
 
開發者ID:vilie,項目名稱:javify,代碼行數:24,代碼來源:CairoGraphics2D.java

示例11: updateAffineTransform

import java.awt.geom.NoninvertibleTransformException; //導入依賴的package包/類
protected void updateAffineTransform() {
	if (!hasServer())
		return;

	transform.setToIdentity();
	transform.translate(getWidth()*.5, getHeight()*.5);
	transform.scale(1.0/downsampleFactor, 1.0/downsampleFactor);
	transform.translate(-xCenter, -yCenter);
	if (rotation != 0)
		transform.rotate(rotation, xCenter, yCenter);

	transformInverse.setTransform(transform);
	try {
		transformInverse.invert();
	} catch (NoninvertibleTransformException e) {
		e.printStackTrace();
	}
}
 
開發者ID:qupath,項目名稱:qupath,代碼行數:19,代碼來源:QuPathViewer.java

示例12: displayCercles

import java.awt.geom.NoninvertibleTransformException; //導入依賴的package包/類
public void displayCercles() {
  // ProjectFrame projectFrame =
  // application.getMainFrame().newProjectFrame();

  this.exampleGraphicFill_Fill_Polygon();
  this.exampleGraphicFill_Stroke_Polygon();
  this.exampleGraphicStroke_Stroke_Polygon();
  this.exampleShadow();
  this.exampleGraphicStroke_Line();
  this.exampleGraphicFill_Line();
  this.exampleTexture();

  FileWriter fichier;
  try {
    fichier = new FileWriter("./src/main/resources/sld/GraphicMark.xml");
    this.projectFrame.getSld().marshall(fichier);
  } catch (IOException e1) {
    e1.printStackTrace();
  }

  try {
    this.projectFrame.getLayerViewPanel().getViewport().zoomToFullExtent();
  } catch (NoninvertibleTransformException e) {
    e.printStackTrace();
  }
}
 
開發者ID:IGNF,項目名稱:geoxygene,代碼行數:27,代碼來源:SLDDemoApplication.java

示例13: setTransform

import java.awt.geom.NoninvertibleTransformException; //導入依賴的package包/類
/**
 * Sets the transform of this node.
 *
 * @param newTransform the new transform of this node
 */
public void setTransform(AffineTransform newTransform) {
    fireGraphicsNodeChangeStarted();
    this.transform = newTransform;
    if(transform.getDeterminant() != 0){
        try{
            inverseTransform = transform.createInverse();
        }catch(NoninvertibleTransformException e){
            // Should never happen.
            throw new Error( e.getMessage() );
        }
    } else {
        // The transform is not invertible. Use the same
        // transform.
        inverseTransform = transform;
    }
    if (parent != null)
        parent.invalidateGeometryCache();
    fireGraphicsNodeChangeCompleted();
}
 
開發者ID:git-moss,項目名稱:Push2Display,代碼行數:25,代碼來源:AbstractGraphicsNode.java

示例14: addRoadNetworkTxtLayer

import java.awt.geom.NoninvertibleTransformException; //導入依賴的package包/類
@Override
public final void addRoadNetworkTxtLayer(final String fileName) {
	int lastIndexOfSeparator = fileName.lastIndexOf(File.separatorChar);
	String populationName = fileName.substring(lastIndexOfSeparator + 1, fileName.lastIndexOf(".")); //$NON-NLS-1$
	logger.info(populationName);
	Population<DefaultFeature> population = RoadNetworkTextfileReader.read(fileName, populationName,
			this.getDataSet(), true);
	logger.info(population.size());

	if (population != null) {
		this.addFeatureCollection(population, population.getNom());
		if (this.getLayers().size() == 1) {
			try {
				this.getLayerViewPanel().getViewport().zoom(population.envelope());
			} catch (NoninvertibleTransformException e1) {
				e1.printStackTrace();
			}
		}
	}
}
 
開發者ID:IGNF,項目名稱:geoxygene,代碼行數:21,代碼來源:AbstractProjectFrame.java

示例15: leftMouseButtonClicked

import java.awt.geom.NoninvertibleTransformException; //導入依賴的package包/類
@Override
public void leftMouseButtonClicked(final MouseEvent e,
    final ProjectFrame frame) {
  try {
    DirectPosition p = frame.getLayerViewPanel().getViewport()
        .toModelDirectPosition(e.getPoint());
    if (e.getClickCount() >= 2) {
      if (this.getPoints().size() >= 3) {
        this.getGeometryToolBar().createPolygon(this.getPoints());
        this.getPoints().clear();
      }
    } else {
      this.getPoints().add(p);
    }
    frame.getLayerViewPanel().superRepaint();
  } catch (NoninvertibleTransformException e1) {
    e1.printStackTrace();
  }
}
 
開發者ID:IGNF,項目名稱:geoxygene,代碼行數:20,代碼來源:CreatePolygonMode.java


注:本文中的java.awt.geom.NoninvertibleTransformException類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。