import("grDevices")
import("grid")
import("lattice")
import("utils")
importFrom("ade4", "as.randtest", "covfacwt", "covwt", "dudi.pca", "dudi.type", "inertia.dudi", "kplot", "meanfacwt", "scatter", "score", "varfacwt", "varwt")
importFrom("graphics", "hist", "plot")
importFrom("KernSmooth", "bkde", "bkde2D")
importFrom("latticeExtra", "panel.ellipse")
importFrom("methods", "callNextMethod", "new", "show", "validObject")
importFrom("RColorBrewer", "brewer.pal")
importFrom("sp", "GridTopology", "is.projected", "Polygon", "Polygons", "proj4string", "sp.grid", "sp.lines", "sp.points", "sp.polygons", "SpatialGrid", "SpatialPointsDataFrame", "SpatialPolygons", "SpatialPolygonsDataFrame", "sppanel")
importMethodsFrom("sp", "[", "bbox", "coerce", "coordinates", "over")
importClassesFrom("sp", "Spatial", "SpatialGrid", "SpatialGridDataFrame", "SpatialLines", "SpatialLinesDataFrame", "SpatialPoints", "SpatialPointsDataFrame", "SpatialPolygons", "SpatialPolygonsDataFrame")
importFrom("stats", "as.formula", "biplot", "coefficients", "dnorm", "formula", "lm", "loess", "predict", "quantile", "reorder", "runif", "screeplot", "weighted.mean")

S3method("biplot", "dudi")
S3method("kplot", "foucart")
S3method("kplot", "mbpcaiv")
S3method("kplot", "mcoa")
S3method("kplot", "mfa")
S3method("kplot", "pta")
S3method("kplot", "sepan")
S3method("kplot", "statis")  
S3method("plot", "acm")
S3method("plot", "betcoi")
S3method("plot", "betdpcoa")
S3method("plot", "betwitdpcoa")
S3method("plot", "betrlq")
S3method("plot", "between")
S3method("plot", "coinertia")
S3method("plot", "discrimin")
S3method("plot", "dpcoa")
S3method("plot", "fca")
S3method("plot", "foucart")
S3method("plot", "inertia")
S3method("plot", "krandboot")
S3method("plot", "krandtest")
S3method("plot", "krandxval")
S3method("plot", "mcoa")
S3method("plot", "mfa")
S3method("plot", "multiblock")
S3method("plot", "multispati")
S3method("plot", "niche") 
S3method("plot", "pcaiv")
S3method("plot", "procuste")
S3method("plot", "randboot")
S3method("plot", "randtest")
S3method("plot", "randxval")
S3method("plot", "rlq")
S3method("plot", "pta")
S3method("plot", "sepan")
S3method("plot", "statis")
S3method("plot", "witcoi")
S3method("plot", "witdpcoa")
S3method("plot", "within")
S3method("plot", "witrlq")
S3method("plot", "bcaloocv")
S3method("plot", "discloocv")
S3method("scatter", "coa")
S3method("scatter", "dudi")
S3method("scatter", "nipals")
S3method("scatter", "pco")
S3method("score", "acm")
S3method("score", "inertia")
S3method("score", "mix")
S3method("score", "pca")
S3method("screeplot", "dudi")
S3method("as.raster", "pixmapRGB")
S3method("as.raster", "pixmapGrey")

export(
  "adegpar",
  "adeg.panel.label",
  "adeg.panel.edges",
  "adeg.panel.nb",
  "adeg.panel.Spatial",
  "adeg.panel.values",
  "adeg.panel.hist",
  "adeg.panel.join",
  "layout2position",
  "changelatticetheme",
  "sortparamADEg",
  "sortparamADEgS",
  "setlimits2D",
  "setlimits1D",
  "plotEig",
  "ADEgS",
  "s.label",
  "s.corcircle",
  "s.arrow",
  "s.class",
  "s.distri",
  "s.value",
  "s.image",
  "s.logo",
  "s.density",
  "s.match",
  "s.Spatial",
  "s.traject",
  "table.value",
  "table.image",
  "triangle.label",
  "triangle.match",
  "triangle.class",
  "triangle.traject",
  "s1d.label",
  "s1d.class",
  "s1d.curve",
  "s1d.curves",
  "s1d.density",
  "s1d.distri",
  "s1d.dotplot",
  "s1d.gauss",
  "s1d.hist",
  "s1d.barchart",
  "s1d.interval",
  "s1d.match",
  "s1d.boxplot",
  "kplot",
  "kplotsepan.coa",
  "biplot",
  "plot",
  "scatter",
  "score",
  "screeplot"
  )

exportMethods(
  "[",
  "[[",
  "[[<-",
  "+",
  "$",
  "length",
  "names",
  "names<-",
  "cbindADEg",
  "rbindADEg",
  "add.ADEg",
  "addhist",
  "addline",
  "addpoint",
  "addsegment",
  "addtext",
  "getcall",
  "getgraphics",
  "getlatticecall",
  "getparameters",
  "getpositions",
  "getstats",
  "gettrellis",
  "insert",
  "panel",
  "panelbase",
  "plot",
  "prepare",
  "print",
  "printSuperpose",
  "setlatticecall",
  "show",
  "superpose",
  "update",
  "zoom"
  )

exportClasses(
  "ADEg",
  "ADEgS",
  "ADEg.C1",
  "ADEg.S1",
  "ADEg.S2",
  "ADEg.T",
  "ADEg.Tr",
  "C1.barchart",
  "C1.curve",
  "C1.curves",
  "C1.density",
  "C1.dotplot",
  "C1.gauss",
  "C1.hist",
  "C1.interval",
  "S1.boxplot",
  "S1.class",
  "S1.distri",
  "S1.label",
  "S1.match",
  "S2.arrow",
  "S2.class",
  "S2.corcircle",
  "S2.density",
  "S2.distri",
  "S2.image",
  "S2.label",
  "S2.logo",
  "S2.match",
  "S2.traject",
  "S2.value",
  "T.cont",
  "T.image",
  "T.value",
  "Tr.class",
  "Tr.label",
  "Tr.match",
  "Tr.traject"
  )
