de.fhg.igd.earth.model.input
Class ShapeFileLoader

java.lang.Object
  extended byde.fhg.igd.earth.model.input.ModelLoader
      extended byde.fhg.igd.earth.model.input.ShapeFileLoader

public class ShapeFileLoader
extends ModelLoader

This "ModelLoader" loads shapefiles into the model. The load method shows a dialog box where you can select the ".shp" file. If a ".dbf" (DBase) file also exists this loader converts its data into the infotable. Title : Earth Copyright : Copyright (c) 2001 Organisation : IGD FhG

Version:
: 1.0
Author:
: Werner Beutel

Field Summary
private  Color color_
          color
private  int detailLevel_
          detail level (0=high detail, 1=low detail)
private  String directory_
          directory
private  float distance_
          distance value
private  String filename_
          filename
private  String filenameDBF_
          absolute .dbf filename
private  String filenameSHP_
          absolute .shp filename
private  boolean lod_
          create a LOD Group ?
private  ModelGraph model_
          model to include into
private  double offsetX_
          x-offset
private  double offsetY_
          y-offset
private  double offsetZ_
          z-offset
private  Frame parent_
          parent frame
private  String plainName_
          plain filename wiithout extension
private  StatusDialog pleaseWait_
          the please wait dialog
private  int recordCounter_
          number of records
private  Vector recordNames_
          record names
private  Vector selected_
          selection list
private  int shapeFileType_
          type of the shapefile
private  String shapeFileTypeName_
          type name of the shapefile
static String shapePath_
          default shapefile path
private  int style_
          style (wire frame, solid, texture)
private  float transparency_
          transparency (0.0-1.0)
 
Fields inherited from class de.fhg.igd.earth.model.input.ModelLoader
datapath_
 
Constructor Summary
ShapeFileLoader()
          Creates an instance of this class.
 
Method Summary
private  boolean chooseFile()
          Shows a dialog where you can choose a shapefile.
private  boolean createRecordNames()
          Creates the record names
 String getIdentName()
          Returns the identName for this class (ShapeFileLoader).
 boolean load(ModelGraph model, Frame parent)
          Loads a shapefile into the model.
 boolean load(ModelGraph model, String name)
          Loads a shapefile directly without a dialog box (simple version)
 boolean load(ModelGraph model, String name, Color color, int style, float transparency, double offsetX, double offsetY, double offsetZ, int detailLevel, float distance, boolean lod)
          Load directly without a dialog window (DEBUG).
 boolean loadFile()
          Opens the shapefile and loads the data into the model.
private  void reset()
          Initializes all variables.
private  boolean showDialog()
          Shows the dialog box to select the records of the shapefile.
private  void showPleaseWait(boolean on)
          Shows the "please wait" window.
 
Methods inherited from class de.fhg.igd.earth.model.input.ModelLoader
setDatapath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

shapePath_

public static final String shapePath_
default shapefile path

See Also:
Constant Field Values

model_

private ModelGraph model_
model to include into


filename_

private String filename_
filename


filenameSHP_

private String filenameSHP_
absolute .shp filename


filenameDBF_

private String filenameDBF_
absolute .dbf filename


plainName_

private String plainName_
plain filename wiithout extension


directory_

private String directory_
directory


parent_

private Frame parent_
parent frame


recordNames_

private Vector recordNames_
record names


selected_

private Vector selected_
selection list


color_

private Color color_
color


style_

private int style_
style (wire frame, solid, texture)


transparency_

private float transparency_
transparency (0.0-1.0)


offsetX_

private double offsetX_
x-offset


offsetY_

private double offsetY_
y-offset


offsetZ_

private double offsetZ_
z-offset


detailLevel_

private int detailLevel_
detail level (0=high detail, 1=low detail)


distance_

private float distance_
distance value


lod_

private boolean lod_
create a LOD Group ?


shapeFileType_

private int shapeFileType_
type of the shapefile


shapeFileTypeName_

private String shapeFileTypeName_
type name of the shapefile


recordCounter_

private int recordCounter_
number of records


pleaseWait_

private StatusDialog pleaseWait_
the please wait dialog

Constructor Detail

ShapeFileLoader

public ShapeFileLoader()
Creates an instance of this class.

Method Detail

getIdentName

public String getIdentName()
Returns the identName for this class (ShapeFileLoader).

Specified by:
getIdentName in class ModelLoader
Returns:
"ShapeFileLoader"

reset

private void reset()
Initializes all variables.


load

public boolean load(ModelGraph model,
                    Frame parent)
Loads a shapefile into the model.

Specified by:
load in class ModelLoader
Parameters:
model - Model to load into
parent - Parent frame
Returns:
true on success.

load

public boolean load(ModelGraph model,
                    String name,
                    Color color,
                    int style,
                    float transparency,
                    double offsetX,
                    double offsetY,
                    double offsetZ,
                    int detailLevel,
                    float distance,
                    boolean lod)
Load directly without a dialog window (DEBUG).

Parameters:
model - Model to load into
name - Name of the shapefile (plain)
color - Color
style - Style
transparency - Transparency
detailLevel - (0=high detail, 1=low detail)
distance - Distance (threshold between high and low detail)
lod - Create a LODGroup ?
Returns:
true on success.

chooseFile

private boolean chooseFile()
Shows a dialog where you can choose a shapefile.

Returns:
true on OK, false on CANCEL

showDialog

private boolean showDialog()
Shows the dialog box to select the records of the shapefile.

Returns:
true on OK, false on CANCEL

load

public boolean load(ModelGraph model,
                    String name)
Loads a shapefile directly without a dialog box (simple version)

Parameters:
model - Model to load into
name - Name of the shapefile (plain)
Returns:
true on success.

createRecordNames

private boolean createRecordNames()
Creates the record names

Returns:
true on success.

loadFile

public boolean loadFile()
Opens the shapefile and loads the data into the model.


showPleaseWait

private void showPleaseWait(boolean on)
Shows the "please wait" window.

Parameters:
on - true=Show false=hide


Copyright © Fraunhofer Gesellschaft. All Rights Reserved.