当前位置: 首页>>代码示例>>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;未经允许,请勿转载。